× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi David,

I was unable to reproduce that problem.
RUNSQL2 CMD('update truc set ma=''hello''')
update truc set ma=''hello''
Press ENTER to end terminal session.

However, there are many ways to handle the quote issue. Here is one I've
used with great success.

Put this at the very bottom of your REXX procedure.

return
/* -------------------------------------------------------- */
/* Strip surrounding single quotes from command parameters. */
/* -------------------------------------------------------- */
stripquotes: procedure
parse arg parm
rparm = parm
if left(rparm,1)="'" then
rparm=substr(rparm,pos("'",rparm)+1,lastpos("'",rparm)-2)
return rparm

Now you have a custom function that can be used in the program:
iSql = stripquotes(iSQL)

Here is a sample program.

parse arg 'CMD('iSql')'
say iSql
iSql = stripquotes(iSql)
say iSql
return
/* -------------------------------------------------------- */
/* Strip surrounding single quotes from command parameters. */
/* -------------------------------------------------------- */
stripquotes: procedure
parse arg parm
rparm = parm
if left(rparm,1)="'" then ,
rparm=substr(rparm,pos("'",rparm)+1,lastpos("'",rparm)-2)
return rparm


Now when I run it:
RUNSQL2 CMD('update truc set ma=''hello''')
'update truc set ma=''hello'''
update truc set ma=''hello''
Press ENTER to end terminal session.


Hopefully using the stripquotes procedure will work for you.


Loyd Goodbar
Business Systems
BorgWarner Shared Services
662-473-5713
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Friday, October 10, 2008 2:50 AM
To: Midrange Systems Technical Discussion
Subject: RE: REXX QIBM_REX_FIND_SRCMBR

Thanks Lloyd. That works for the given example.

But something's still not quite right.
If I try MYREXCMD CMD('update truc set ma=''hello''')
REX will SAY update truc set ma=''l''

And obviously the SQL will not run. I can't see how to eliminate the
extra quote marks.
The same command runs fine in my command with a CL as CPP.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.