DB2 LOAD Utility mit neuer Funktion
Endlich: Konstante angeben und mit DB2 z/OS LOAD Utility laden
Neue Funktion für User des DB2 10 for z/OS und DB2 11 for z/OS LOAD Utility: Endlich können konstante Werte, wie z.B. eine feste Mandanten-Nummer, ein Buchungsdatum, eine Datenquellenbezeichnung während des Ladevorgangs per DB2 LOAD Utility berücksichtigt werden. Zuvor mussten Ladebestände passend bereitgestellt, oder aufwändig mit IEBCOPY/IEBGENER/DFSORT o.ä. vorbereitet werden.
Users require the ability to specify a constant value for a field on LOAD. In some cases a value is not included for a field in the record and the column was not created with a default. Also, the default for a column might not be the desired value for this LOAD. The ability to specify a
constant value for an input field gives flexibility to replace a value from the record or specify a value when one is not included in the record.
Alles nachzulesen im IBM DB2 Support Record PI62566.
field specification:
>>-field-name--+----------------------------+------------------>
'-POSITION(start-+------+-)-'
' '-:end-' '
'-constant-specification----'
constant-specification:
+-CONSTANT(-+--'string'----------+-)--------------------------->
+--X'hex-string'-----+
+--integer------------+
+--CURRENT DATE-------+
+--CURRENT TIME-------+
+--CURRENT TIMESTAMP--+
'--NULL---------------+
CONSTANT
Specifies that the column matching the field name should be
loaded with a constant value. The field name that is associated
with the CONSTANT keyword must coincide with a table column
name. The length and type of the CONSTANT field is derived from
the specified value and must be valid for the target column.
'string'
Specifies the character string that is to be inserted in the
target column. If the given string is in the form 'string', it
is assumed to be in the encoding scheme of SYSIN even if the
encoding scheme of SYSREC is not the same. Conversion may be
applied before inserting the string into the target column.
X'hex-string'
Specifies the character string in hexadecimal form,
X'hex-string', that is to be inserted in the target column.
integer
Specifies the integer that is to be inserted into the target
column. Valid values are between -2 147 483 648 and
2 147 483 647.
CURRENT DATE
Specifies that the current date is to be inserted into the
target column.
CURRENT TIME
Specifies that the current time is to be inserted into the
target column.
CURRENT TIMESTAMP
Specifies that the current timestamp is to be inserted into the
target column.
NULL
Specifies that the target column should be set to NULL. The
target column must be nullable.
For a CONSTANT field, no other field specification options are
permitted. A CONSTANT field is not permitted for LOB or XML
columns.




Comments
Comments are closed.