Can we invoke a BTEQ script from a BTEQ script?

Tools & Utilities
Enthusiast

Can we invoke a BTEQ script from a BTEQ script?

Can we invoke a BTEQ script from a BTEQ script?
3 REPLIES
Teradata Employee

Re: Can we invoke a BTEQ script from a BTEQ script?

Hello,

Yes you can using ".RUN FILE = ;". Following is an example:

Script-1: "S1.bteq"

.LOGON dbc,dbc;

SELECT DATABASE;

.RUN FILE = S2.bteq;

.LOGOFF;

Script-2: "S2.bteq"

Script-1: "S1.bteq"

.LOGON dbc,dbc;

SELECT * FROM Table1;

.LOGOFF;

HTH.

Regards,

Adeel
Enthusiast

Re: Can we invoke a BTEQ script from a BTEQ script?

Thanks for the quick response
Enthusiast

Re: Can we invoke a BTEQ script from a BTEQ script?

In addition to .RUN, you can use the .OS command to execute bteq or any other shell command. For example:

.os bteq < my_bteq_script

.os arcmain < my_archive_script