Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 19 Feb 2004 @ 23:03:36 GMT


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


Subj:   Re: BTEQ Import, Variable Substitution Error
 
From:   Paul Swier

When we create databases we pass are able to pass in the database name. I can not take credit for this script but it seems to work.

First we created a db.lst that looks like the following:

TMDSRI|Y

The first name is the database.

Then we have our bteq script that looks like this:

.logon ;
.set width 254;
.set titledashes off;
.set maxerror 0;
.set errorout stdout;
.OS del tmp.bte;
.export report file=tmp.bte;
select '.logon tddevelm/sysdba;' (title '');
select '.set width 254;' (title '');
select '.set titledashes off;' (title '');
select '.set maxerror 0;' (title '');
select '.set errorout stdout;' (title '');
.import vartext '|' file=db.lst
.repeat *
using (tdb varchar(30)  ,ri varchar(1))
select 'delete database '||trim(:tdb)||';' (title '')
;select ' database '||trim(:tdb)||';'  (title '')
;select case when :ri = 'N' then '.run file=tmds_nori.sql;'
                            else '.run file=tmds_ri.sql'  end (title '')
;
.export reset;
.logoff;
.quit;

We used the import vartext command to pass in the name of the database.

Not sure if this helps or just confuses everyone.



     
  <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