16.20 - NUMBER Literals - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

Teradata Database does not provide NUMBER literals. You can use other numeric literals to initialize NUMBER fields; however, you cannot directly initialize a NUMBER with more than 38 digits, or when using FLOAT literals, more than 14 digits. For example, you can use the CAST function to explicitly cast a numeric literal to NUMBER:

SELECT ProdID
FROM PartsTbl
WHERE CustID = CAST(9876543210 AS NUMBER);

You can also create a NUMBER value from a character string. Normally you cannot have more than 38 numeric characters in a string literal; however, for the NUMBER data type, you can have up to 64 numeric characters in a string literal. For example:

CREATE TABLE t1 (pk INTEGER, col1 NUMBER);
INSERT INTO t1 (1, '123456789012345678901234567890123456789');