Overview
identity is a synonym for the variable last_insert_id, which can be queried using select @@identity.
Privilege requirements
Query variables
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.Modify variables
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Uint |
| Default Value | 0 |
| Value range | [0, 18446744073709551615] |
| Effective Scope | Session |
| Modifiable | Yes, you can use the following methods:SETStatement modification. |
Configuration example
Update the auto-increment field value to 1001 for the last inserted record.
obclient> SET identity= 1001;