Updated on 2024-05-31 GMT+08:00

Forced Conversion Functions

Table 1 Forced conversion functions

No.

MySQL

GaussDB

Difference

1

CAST()

Supported

  • In GaussDB, CAST(expr AS CHAR[(N)] charset_info or CAST(expr AS NCHAR[(N)]) cannot be used to convert character sets.
  • In GaussDB, CAST(expr AS JSON) cannot be used to convert expressions to JSON.
  • In GaussDB, you can use CAST(expr AS FLOAT[(p)]) or CAST(expr AS DOUBLE) to convert an expression to the one of the floating-point type. MySQL 5.7 does not support this conversion.

2

CONVERT()

Supported

  • In GaussDB, CONVERT(expr, CHAR[(N)] charset_info or CAST(expr, NCHAR[(N)]) cannot be used to convert character sets.
  • In GaussDB, CAST(expr, JSON) cannot be used to convert expressions to JSON.
  • In GaussDB, you can use CONVERET(expr, FLOAT[(p)]) or CONVERT(expr, DOUBLE) to convert an expression to the one of the floating-point type. MySQL 5.7 does not support this conversion.