Archives of the TeradataForum
Message Posted: Tue, 26 Dec 2006 @ 12:12:23 GMT
Subj: | | Re: More than one .EXPORT statements |
|
From: | | McCall, Glenn David |
| Can we use two .export statements in one bteq script???? I have an oracle script that contains two select statements. Both the statements
are spooling to two different files. I tried to convert it to teradata but I am unaware whether i could use two .export statements to export data
to two different files. Kindly help me out in this matter. | |
You can use multiple export commands in a single bteq script, but only one export is valid at a time and the export can only go to one
file.
I'm not sure what you are trying to achieve, but if you need exactly the same content in a second file, you could use the .os command to make a
copy.
For example (assuming unix)
.export report file=/tmp/somefile.txt
Select * from some_table;
.export reset
.os cp /tmp/somefile.txt /tmp/copyofsomefile.txt
If you use a second .export command, it will override the first. On the other hand if you are running two different queries and you want
the output to go to different files then this should work.
.export report file=/tmp/query1.txt
Select * from tbl_1;
.export report file=/tmp/query2.txt
Select * from tbl_2;
.export reset
I hope this helps. BTW, did you simply try this? Sometimes that is the easiest way to see if it will work.
Glenn Mc
|