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

SIGN

SIGN

A math function that returns a numeric value that indicates the sign of the input expression. SIGN can have the following return values:
  • -1. Value is less than zero.
  • 0. Value is zero.
  • 1. Value is greater than zero.
If the input value is an INTEGER, then the return value is INTEGER as well. Similarly, if the input is SMALLINT, the output is SMALLINT. Otherwise, a FLOAT value is returned.

SIGN Syntax

SIGN (double)

SIGN Examples

Input
Output
173
1
-173
-1
-173.34
-1.00000000000000e+00
173.34
1.00000000000000e+00
0
0
CREATE TABLE num_table (int_col INT, float_col FLOAT); INSERT INTO num_table VALUES (173, 173.34); 1 row affected INSERT INTO num_table VALUES (-173, -173.34); 1 row affected INSERT INTO num_table VALUES (0, ); 1 row affected SELECT int_col, SIGN(int_col) AS result FROM num_table; 3 rows selected int_col result ----------- ----------- 173 1 -173 -1 0 0 SELECT float_col, SIGN(float_col) AS result FROM num_table WHERE float_col IS NOT NULL; 2 rows selected float_col result ---------------------- ---------------------- 1.73340000000000e+02 1.00000000000000e+00 -1.73340000000000e+02 -1.00000000000000e+00

0 COMMENTS

We’d like to hear from you!