Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 26 Dec 2006 @ 12:12:23 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023