TheBugSlayer
Programmer
Hello good people.
I am struggling with a minor situation:
I need to pass either local variables or parameters of the batch/command file to an OSQL call inside the file. Here is a snippet of my CMD file:
If parameters were passed where 2 is source and 3 target, I would like to use a call like this:
But none is working so for now I hard code all the paths. When I add ECHO statements to the CMD file to see the variables I see their name instead of their content. What is the correct way to pass those values to the OSQL command?
Your help is appreciated.
I am struggling with a minor situation:
I need to pass either local variables or parameters of the batch/command file to an OSQL call inside the file. Here is a snippet of my CMD file:
Code:
...
if "%1" == "DEV" goto setDEV
...
:setDEVL
set srv = DEVELOP
set target = \\FSRVDEV\in\
set source = \\FSRVDEV\out\
goto runImport
...
:runImport
osql -S%srv% -E -dPDX_MAIN -Q"EXEC p_Load_CCHR2_Tables %target% , %source%"
If parameters were passed where 2 is source and 3 target, I would like to use a call like this:
Code:
osql -S%srv% -E -dPDX_MAIN -Q"EXEC p_Load_CCHR2_Tables %2% , %3%"
But none is working so for now I hard code all the paths. When I add ECHO statements to the CMD file to see the variables I see their name instead of their content. What is the correct way to pass those values to the OSQL command?
Your help is appreciated.