I am creating a generic script that will parse a statement and return the result. I have done so in shell, but don't know how this can happen in batch scripting
Script 1 Main script (main.bat).
SET Myresult=CALL child.bat "Statement"
Now Myresult should store the answer whatever I want to return in this variable.
Solution 1 : SET Myresult in Child.bat and use it in main.bat but now what if the user does not know what the variable name is .
So is their a way to return a value like in java return xyz
xyz gets captured in the call statement elsewhere.
-------------------------------xxxxxxxxxxxxxxxxxxxxxxx-----------
PART 2
Here are the details of what I am doing .
The so called child script is getSQLResult.bat
What is does is
getSQLResult.bat -q "Select a from abc"
Now this above call statement can be used by anyone any how in any batch script .
So apart from passing a variablename(return name) or writing a for loop to parse the result set is there any simple straight forward way .