Purpose
UID() returns the ID of the current logged-on user.
Syntax
UID
Return type
An integer is returned.
Examples
Create a table named tbl1 and insert the ID of the current user to the tbl1 table.
obclient> CREATE TABLE tbl1(col1 INT,user_id INT);
Query OK, 0 rows affected
obclient> INSERT INTO tbl1 VALUES(1,UID),(2,UID),(3,UID);
Query OK, 3 rows affected
Records: 3 Duplicates: 0 Warnings: 0
obclient> SELECT * FROM tbl1;
+------+------------------+
| COL1 | USER_ID |
+------+------------------+
| 1 | 1101710651031555 |
| 2 | 1101710651031555 |
| 3 | 1101710651031555 |
+------+------------------+
3 rows in set