NUMBER Literals - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

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