All the Database Management Systems supported by
SAP Advanced SQL Migration
(Oracle, SQL Server, IBM DB2 LUW, Teradata and Netezza) allow users to explicitly perform data conversions and also to format outputs when presenting data to the clients. For conversion they use to provide Built-in Functions like cast/convert and while for format they have other Built-in Functions like to_char, check these 2 examples from Teradata:
BTEQ
select to_char (12345.67, '$99999,999.99');
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
to_char(12345.67,'$99999,999.99')
$12,345.67
BTEQ
select cast (to_char (12345, '$99999,999.99') as float);
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
to_char(12345,'$99999,999.99')
1.23450000000000E 004
But among them all Teradata has a kind of slightly different extra way to do it beside the generic way using the typical functions, their official name in Teradata language is the
FORMAT PHASE
The FORMAT PHRASE is an expression using parentheses located after the column and expression, and in it, you can specify things like:
DATA TYPE for the output:
BTEQ
SELECT 12345 (FLOAT);
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
12345
1.23450000000000E 004
Pedro Pascal
Se unió el 07/03/2018