Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

DEC

DEC

A cast function that converts a numeric or string input to the DECIMAL datatype and returns the value. Optionally, the precision and scale for the converted DECIMAL value can be set. If omitted, the following default precisions are used, depending on the input type:
  • SMALLINT:
    5
  • INTEGER:
    11
  • UNSIGNED:
    19
  • other:
    15
The default scale is
0
in all cases.

DEC Syntax

DEC ( char value-expression [ , precision [ , scale ] ] ) DECIMAL ( char value-expression [ , precision [ , scale ] ] )

DEC Examples

Input
Output
'1234.567', 10, 5
1234.56700
5.67192e3
5672
CREATE TABLE string_table (col1 VARCHAR(20)); INSERT INTO string_table VALUES ('1234.567'); 1 row affected SELECT DEC(col1, 10, 5) FROM string_table; 1 row selected 1 ------------ 1234.56700 CREATE TABLE num_table (col1 FLOAT); INSERT INTO num_table VALUES (5.67192e3); 1 row affected SELECT DEC(col1) FROM num_table; 1 row selected 1 ----------------- 5672

0 COMMENTS

We’d like to hear from you!