Updated on 2025-06-30 GMT+08:00

DCL

Table 1 DCL syntax compatibility

Description

Syntax

Difference

Set user-defined variables.

SET

Difference in the length of a user-defined variable. For example:
  • There is no restriction on the length of MySQL user-defined variable names.
  • The length of a user-defined GaussDB variable name cannot exceed 64 bytes. If the length exceeds 64 bytes, the excess part will be truncated and an alarm will be generated.

Support the SET TRANSACTION syntax.

SET TRANSACTION

In MySQL, you can set the transaction isolation level and read/write mode for the current session and global. In GaussDB, you need to set the b_format_behavior_compat_options parameter to include set_session_transaction for the current session. The global setting takes effect only for the current database.

Set names with COLLATE specified.

SET [ SESSION | LOCAL ] NAMES {'charset_name' [COLLATE 'collation_name'] | DEFAULT};

GaussDB does not allow charset_name to be different from the database character set. For details, see "SQL Reference > SQL Syntax > S > SET" in Developer Guide.