Page 1 of 1

Adding quotes to a variable

Posted: 30 Apr 2009 10:16
by mwilson58
I have a variable that is passed to a .bat file within the bat file

SET MYVAR1=%1

db2 call myuser.myproc(%MYVAR1%)

What I need to do is wrap the variable is single quotes

i.e. DB needs to be 'DB'

Thank you in advance for your assistance

Marcus

Never mind... figured it out

Posted: 30 Apr 2009 10:41
by mwilson58
Thanks

I just need to fight the dragon for a few more minutes.

Re: Adding quotes to a variable

Posted: 15 Sep 2011 02:15
by trebor68
You can do it with the first opportunity:

SET MYVAR1='%1'
db2 call myuser.myproc(%MYVAR1%)

or second opportunity:

SET MYVAR1=%1
db2 call myuser.myproc('%MYVAR1%')

If you want to start i.E. myuser.myproc('DB')

Re: Adding quotes to a variable

Posted: 15 Sep 2011 19:07
by nitt
mwilson58 wrote:I have a variable that is passed to a .bat file within the bat file

SET MYVAR1=%1

db2 call myuser.myproc(%MYVAR1%)

What I need to do is wrap the variable is single quotes

i.e. DB needs to be 'DB'

Thank you in advance for your assistance

Marcus


"db2"... "declare bytes 2"... What kind of Assembly-derived command is that?! Where you download?