Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 26 Feb 2008 @ 18:55:24 GMT


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


Subj:   Re: Can I give Input values to BTEQ file?
 
From:   Curley, David

You can't pass positional parameters to BTEQ (the way you can with SQL*Plus, if you've been working with Oracle).

In Windows, as Victor said, you'd have to do all substitutions in test.txt before running it. You could probably create a batch file to automate that, though. I'd imagine it wouldn't be too hard with Power Shell, either.

In Unix, you can use environment variables by wrapping the BTEQ script in a shell script and using input redirection.

You call

     test.sh 10 True

Where a bare-bones (and silly) test.sh looks like

     bteq << EOF
     .logon db/name,password;
     .export file /where/your/output/should/go.txt
     Select tablename, ''$2''
     from dbc.tables
     qualify row_number() over (order by tablename) < $1;

     .exit
     EOF

Dave



     
  <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: 27 Dec 2016