Archives of the TeradataForum
Message Posted: Fri, 04 Feb 2011 @ 16:10:09 GMT
Subj: | | Re: Bteq and Mload script errors |
|
From: | | Prescott, Kyle |
1) Your data is text based - not INTEGER. Integer is a 4-byte binary number. Also the data in the COL2 is not VARCHAR, but CHAR. VARCHAR will
have a preceding 2-byte binary value describing the actual length of the variable character data.
FWIW - for larger input datasets, you can also get better throughput by defining multiple sessions to insert the data in parallel to the data
table. You can set multiple sessions (I set to 10 in the example below) prior to logon. You can also use a pack rate (example PACK 50 to pack 50
rows together before sending to TDATA for insertion). This better utilize the network channel by packing the data together and sending to the
amps in larger blocks to be inserted from the amps. Similar to what TPUMP does.
.SET SESSIONS 10;
.logon Database/userid, pwd
.IMPORT REPORT FILE = c:\bteq\source1.txt .quiet on
.repeat * PACK 50
using (COL1 CHAR(8),
FILLER1 CHAR(1), COL2 (CHAR(12))
insert into Database.tablename (customer_number,NAME)
values (:col1 (FORMAT'9(8)'),:col2);
.logoff;
.quit;
2) ALL your input data layout needs to be defined as VARCHAR(x) for VARTEXT usage. Mload treats all the input data as VARCHAR parsing
the input record for the delimiting character specified.
|