Supported scalar expressions – HP Neoview Release 2.5 Software User Manual
Page 44
Example:
EMP_ID = identity loader
Asks the loader to generate a key for target field EMP_ID.
scalar-expression
A simple expression composed of a fieldname_source, constant, and SQL functions
connected by simple arithmetic operators. This expression must be syntactically valid
for fitting into a corresponding SQL insert, update, or upsert statement. The maximum
length of a scalar-expression is 256 characters. This option is not supported for
extract operations and is not allowed on primary key columns. If a partition key field
is defined as an expression, prehashing cannot be performed on that field; the data
is loaded with a single stream in that case.
NVL
function
This function allows the use of an expression to convert a null into a value that
can be loaded into a NOT NULL column.
Example 5-1 Supported Scalar Expressions
•
COL1 = expression ":COL1 * 5+2",
COL1 = expression "ASCII(current_user) + :COL1",
•
COL1 = expression "abs (:COL1)",
•
COL1 = expression "upper(:COL1)",
•
vchr1 = expression "dayname(current_date)",
•
COL1 = expression " date_part('second' , :COL1) ",
COL2 = expression "converttimestamp (juliantimestamp (:COL2) - 19)",
•
COL1 = expression "dateadd(day,3,:COL1)",
•
COL1 = expression "CAST (REPLACE(:COL1, ',','.') as NUMERIC(10,2)
•
COL2 = expression "interval '40' month + :COL2",
COL8 = expression "cast (:COL8 as interval hour to minute)",
•
COL1 = expression "cast(:COL1 || ' ' || dayname(current_date) as varchar(12)) ",
•
COL2 = expression "pi () + sin(:COL2)"
•
col2 = expression "NVL(CAST(:field2 AS INT), DEFAULT)",
field-source-ref
For an extract operation, field-source-ref must be one of the following:
•
fieldname-source
(without the add or subtract option)
•
NULL
•
constant
field-mapping-options
A list of options.
condition = “true” | “false”
This option is only applicable for load operations where the operation type is update,
upsert, or delete. If condition is true, this field becomes part of the conditions in the
WHERE clause of the generated SQL statement.
This option must be set to false for an identity field mapping if the operation is update,
upsert, or delete. Otherwise, Transporter returns an error.
The default is “false” for non-key columns and “true” for key columns.
44
Control File Organization and Syntax