17.10 - NUMBER Literals - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

Vantage 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');