All Forums Tools
NMadson-3173 44 posts Joined 09/06
17 Jul 2007
pass parameter to BTEQ script from a Windows batch file

Is there a way to pass a parameter to a BTEQ script that is called by a Windows batch file?I tried the lineselect count(*) from tbl_%1 where %1 is 200612, but I get an error message.N.

leo.issac 184 posts Joined 07/06
19 Jul 2007

You can generate script similar to below mentioned script.del scr01.txtecho .logon localhost/test,test >>scr01.txtecho select * from samples01.%1% ; >>scr01.txtecho .logoff >> scr01.txtecho .quit >> scr01.txtbteq < scr01.txtand run the batch script as belowC:\>scr02.bat test1C:\>del scr01.txtC:\>echo .logon localhost/test,test 1>>scr01.txtC:\>echo select * from samples01.test1 ; 1>>scr01.txtC:\>echo .logoff 1>>scr01.txtC:\>echo .quit 1>>scr01.txtC:\>bteq 0BTEQ 08.02.00.00 Thu Jul 18 09:33:12 2007+---------+---------+---------+---------+---------+---------+---------+----.logon localhost/test, *** Logon successfully completed. *** Transaction Semantics are BTET. *** Character Set Name is 'ASCII'. *** Total elapsed time was 3 seconds.+---------+---------+---------+---------+---------+---------+---------+----select * from samples01.test1 ; *** Query completed. One row found. One column returned. *** Total elapsed time was 1 second. a----------- 10+---------+---------+---------+---------+---------+---------+---------+----.logoff *** You are now logged off from the DBC.+---------+---------+---------+---------+---------+---------+---------+----.quit *** Exiting BTEQ... *** RC (return code) = 0

You must sign in to leave a comment.