§ Oracle Compatibility - Function - CAST()
§ 1. Syntax
CAST(expr AS VARCHAR(N))
1
§ 2. Definition and Usage
Based on the native CAST() function, this adds syntactic support for the VARCHAR(N) type.
§ 3. Examples
greatsql> SELECT CAST('greatsql' AS VARCHAR(10)), CAST('greatsql' AS VARCHAR(5));
+---------------------------------+--------------------------------+
| CAST('greatsql' AS VARCHAR(10)) | CAST('greatsql' AS VARCHAR(5)) |
+---------------------------------+--------------------------------+
| greatsql | great |
+---------------------------------+--------------------------------+
1 row in set, 1 warning (0.00 sec)
greatsql> SHOW WARNINGS;
+---------+------+-----------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------+
| Warning | 1292 | Truncated incorrect CHAR(5) value: 'greatsql' |
+---------+------+-----------------------------------------------+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Scan the QR code to follow our WeChat official account
