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

MOD

MOD

A math function that returns the remainder of
value-expression1
divided by
value-expression2
. The return value is negative only if
value-expression1
is negative. If
value-expression2
is 0, the function returns
value-expression1
. If either of the arguments is a null value, the result is a null value.

MOD Syntax

MOD (double value-expression1, double value-expression2)

MOD Examples

Input
Output
8, 5
3
127,62
3
-4,2
0
-4,3
-1
NULL,1
NULL
CREATE TABLE num_table (exp1 SMALLINT, exp2 SMALLINT, result SMALLINT); INSERT INTO num_table VALUES (8, 5, ); 1 row affected INSERT INTO num_table VALUES (127, 62, ); 1 row affected INSERT INTO num_table VALUES (-4, 2, ); 1 row affected INSERT INTO num_table VALUES (-4, 3, ); 1 row affected INSERT INTO num_table VALUES ( , 1, ); 1 row affected UPDATE num_table SET result = MOD(exp1, exp2); 5 rows affected .NULLS ***** SELECT * FROM num_table; 5 rows selected EXP1 EXP2 RESULT ------ ------ ------ 8 5 3 127 62 3 -4 2 0 -4 3 -1 ***** 1 *****

0 COMMENTS

We’d like to hear from you!