How can I pass a parameter to BTEQ during run time (In Windows)?
I have 2 DB's like QA_TEST & DEV_TEST
I need to test the BTEQ script with both QA and DEV data. So instead of creating 2 BTEQ's, is there a way i can pass QA_TEST DB for my QA testing and DEV_TEST DB for my dev testing?
...have you already thought about a simple replacement of a unique text pattern :
In a unix environment the following is working: (i'm not too familiar with current windows scripting possibilities, but a similar approch should be possible there, too ?!).
You specify the DB in the BTEQ-Script using a unique textstring e.g. '&TD_DB' (the $-sign is not absolutely necessary as long as the textstring does only appear at positions where it shall be replaced. we use it to emphasize that there is a parameter that has to be replaced at runtime). Then you can call the BTEQ Script for QA-Testing as follows:
> sed 's/\&TD_DB/QA_TEST/g' < test.btq | bteq
If you are using UNIX to run the BTEQ u can try parm file..
create a param file and assign value for your DB ex:userfolder/param
inside that create a variable that your going to use in BTEQ and assign it to respective replacement value
in the script point to that param location like
Inside the bteq use $TD_DB in the query.while running it will b automatically replaced by the param value
Hello, I was searching a solution on internet for this topic, one solution that you can try is to create and pass the parameters bye a .bat file, and then execute the .bat file:
STEP 1: Create a .bat file (script.bat) with the context of the bteq an the parameters ex:
I have created a Python package for dealing the same situation, you can have a look https://github.com/zhongdai/wbteq.
Python 3 is required to install this package.