Note
This variable is available starting with in V2.1.
Description
sql_warnings is used to control whether an information string is generated when a warning occurs during a single-row INSERT statement.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or querySYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle-compatible mode) orinformation_schema.GLOBAL_VARIABLES(MySQL-compatible mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or querySYS.TENANT_VIRTUAL_SESSION_VARIABLE(Oracle-compatible mode) orinformation_schema.SESSION_VARIABLES(MySQL-compatible mode) to query the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.For V4.x, starting from V4.2.0, Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Set the variable at the session level
The
systenant and all user tenants can directly modify the value of a session system variable in the current tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Bool |
| Default value | OFF |
| Valid values | ON: Generate an information string.OFF: Do not generate an information string. |
| Scope | |
| Modifiable | Yes. You can modify this variable by using the SET statement. |
Examples
Set single-row INSERT statements to not generate an information string when a warning occurs.
Session level
obclient> SET sql_warnings= OFF;Global level
obclient> SET GLOBAL sql_warnings= OFF;