Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 calling isql utility thru a batch file - parameter problem.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-07 : 11:20:58
Muthiah writes "I am calling following isql command thru a batch file.

--qte--
isql -S%1 -U%2 -P%3 -d%4 -w9999 -h-1 -s"|" -Q"EXEC WP_InvExport '%5','%6','%7','%8','%9' " -o%10
--qte--

For Output file parameter, I am using parameter value of '%10' from my batch file..

But it takes value of parameter '%1' instead of '%10'

Is there any soultions to 10th Parameter value thru a batch file.?

Or can pass more than 9 parameter to a batch file ?


Rgds
Muthiah"

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2004-05-07 : 11:20:58
I've never been able to pass more than 10 parameters. Someone else may have a better solution though.
Go to Top of Page

gpl
Posting Yak Master

195 Posts

Posted - 2004-05-07 : 17:50:54
Muthiah
The only way to access more than 9 params is to use the SHIFT command ... you then need to pass the parameters into environment variables, something like this (please forgive me if the syntax is wrong, its a while since I did much batch programming)

Set Param1=%1
Shift
Set Param2=%1
Shift
Set Param3=%1
Shift
Set Param4=%1
Shift
Set Param5=%1
Shift
Set Param6=%1

and so on -- yes I do mean to refer to %1 each time, shift moves all the params down 1
as I remember, the environment variables dont disappear at the end of the batch, so you need to tidy up at the end with this

Set Param1=
Set Param2=
Set Param3=
Set Param4=
Set Param5=
Set Param6=

Good luck with this
Graham
Go to Top of Page
   

- Advertisement -