25.09.2015 Views

Teradata Parallel Data Pump

Teradata Parallel Data Pump Reference - Teradata Developer ...

Teradata Parallel Data Pump Reference - Teradata Developer ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3: <strong>Teradata</strong> T<strong>Pump</strong> Commands<br />

FIELD<br />

Example 1<br />

Instead of specifying the following:<br />

...<br />

.FIELD fc * CHAR(5) NULLIF fc = 'empty';<br />

.FIELD fi * INTEGER NULLIF fi = 0;<br />

...<br />

.DML LABEL ins;<br />

INSERT INTO tbl1 VALUES(...,:fc,:fi,...);<br />

Use this instead:<br />

...<br />

.FIELD fc * CHAR(5);<br />

.FIELD fi * INTEGER;<br />

...<br />

.DML LABEL ins;<br />

INSERT INTO tbl1 VALUES(...,NULLIF(:fc,'empty'),NULLIF(:fi,0),...);<br />

Example 2<br />

In more complex situations, as in the following example:<br />

...<br />

.FIELD fs * CHAR(1) ;<br />

.FIELD fc * CHAR(5) NULLIF (fs 'M') AND (fs 'F');<br />

.FIELD fi * INTEGER NULLIF fi < 0;<br />

...<br />

.DML LABEL ins;<br />

INSERT INTO tbl2 VALUES(...,:fs,:fc,:fi,...);<br />

Use this instead:<br />

...<br />

.FIELD fs * CHAR(1) ;<br />

.FIELD fc * CHAR(5);<br />

.FIELD fi * INTEGER;<br />

...<br />

.DML LABEL ins;<br />

INSERT INTO tbl2 VALUES(...,:fs,<br />

CASE WHEN (:fs = 'M') OR (:fs = 'F') THEN :fc ELSE NULL END,<br />

CASE WHEN (:fi >= 0) THEN :fi ELSE NULL END,...);<br />

Using ANSI/SQL DateTime <strong>Data</strong> Types<br />

When the DATEFORM command is used to specify ANSIDATE as the DATE data type, each<br />

DATE field is internally converted to a CHAR(10) field. All ANSI/SQL DateTime TIME,<br />

TIMESTAMP, and INTERVAL data types must be converted to fixed-length CHAR data types<br />

to specify column and field names in a <strong>Teradata</strong> T<strong>Pump</strong> FIELD command.<br />

Table 28 shows how to use ANSI/SQL DateTime specifications.<br />

138 <strong>Teradata</strong> <strong>Parallel</strong> <strong>Data</strong> <strong>Pump</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!