|
|
Archives of the TeradataForum
Message Posted: Mon, 29 Nov 2004 @ 13:01:25 GMT
Subj: | | Re: Spooling a Teradata table to a text file using .EXPORT |
|
From: | | David Clough |
One for Michael Larkins, I suspect:
Having successfully Exported the data (as suggested) using
.set heading off
.set titledashes off
.export report file=D:\WUTemp\cs_vendor_cell_offer5.txt
select
CAST(id_strategy AS CHAR(9)) id_strategy
,CAST(id_vendor_cell AS CHAR(9)) id_vendor_cell
,CAST(id_cross_sell AS CHAR(8)) id_cross_sell
,CAST(id_offer AS CHAR(9)) id_offer
,CAST(num_priority AS CHAR(9)) num_priority
,CAST(num_days_between_offers AS CHAR(9)) num_days_between_offers
from cs_vendor_cell_offer
order by id_vendor_cell, num_priority;
.export reset
with table definition and insert statements:
CT cs_vendor_cell_offer
(id_strategy CHAR(5), id_vendor_cell CHAR(4), id_cross_sell CHAR(4),
id_offer CHAR(4), num_priority CHAR(1), num_days_between_offers SMALLINT);
INS INTO cs_vendor_cell_offer VALUES ('STR01', 'VND1', 'CS01', 'O001', '3',30);
INS INTO cs_vendor_cell_offer VALUES ('STR02', 'VND2', 'CS02', 'O002', '3',30);
INS INTO cs_vendor_cell_offer VALUES ('STR03', 'VND3', 'CS03', 'O003', '3',30);
how would I then be able to use the exported file (after manually deleting the header record) in order to Import into an identical table
(perhaps in a different database)? Any ideas?
Thanks
| |