Categories:
System Functions (System Information)

SYSTEM$TYPEOF

Returns a string representing the SQL data type associated with an expression.

Syntax

SYSTEM$TYPEOF( <expr> )

Usage Notes

  • If TYPEOF is executed without the SYSTEM$ prefix (i.e. as a regular function rather than a system function), it returns different results (see TYPEOF).

Examples

SELECT SYSTEM$TYPEOF(null) FROM (values(1)) v;

---------------------+
 SYSTEM$TYPEOF(NULL) |
---------------------+
 NULL[LOB]           |
---------------------+
SELECT SYSTEM$TYPEOF(1) FROM (values(1)) v;

------------------+
 SYSTEM$TYPEOF(1) |
------------------+
 NUMBER(1,0)[SB1] |
------------------+
SELECT SYSTEM$TYPEOF(1e10) FROM (values(1)) v;

---------------------+
 SYSTEM$TYPEOF(1E10) |
---------------------+
 NUMBER(11,0)[SB8]   |
---------------------+
SELECT SYSTEM$TYPEOF(10000) FROM (values(1)) v;

----------------------+
 SYSTEM$TYPEOF(10000) |
----------------------+
 NUMBER(5,0)[SB2]     |
----------------------+
SELECT SYSTEM$TYPEOF('something') FROM (values(1)) v;

----------------------------+
 SYSTEM$TYPEOF('SOMETHING') |
----------------------------+
 VARCHAR(9)[LOB]            |
----------------------------+
SELECT SYSTEM$TYPEOF(CONCAT('every', 'body')) FROM (values(1)) v;

----------------------------------------+
 SYSTEM$TYPEOF(CONCAT('EVERY', 'BODY')) |
----------------------------------------+
 VARCHAR(9)[LOB]                        |
----------------------------------------+