Here's my REXX that works :
PARSE ARG iSql
RC=0
ADDRESS EXECSQL,
EXECSQL 'SET OPTION COMMIT = *NONE'
ADDRESS EXECSQL,
EXECSQL iSql
This is the one that doesn't, adapted so I can use *REXX as the CPP
PARSE ARG 'CMD('iSql')'
RC=0
SAY iSql
ADDRESS EXECSQL,
EXECSQL 'SET OPTION COMMIT = *NONE'
ADDRESS EXECSQL,
EXECSQL iSql
If run MYREXCMD CMD('delete from inexistanttable'),
I get :
'delete from inexistanttable'
6 *-* Address EXECSQL EXECSQL iSql;
+++ RC(-10)
It then does a SNDPGMMSG of the error giving :
ID message . . . . . . : SQL0104
Message . . . . : Elément syntaxique 'delete from inexistanttable' n'est pas
correct. Eléments possibles : ( END GET SET CALL DROP FREE HOLD.
If I try the same in my working version, I get
SQL0204
INEXISTANTTABLE de type *FILE dans *LIBL non trouvé.
Which is what I expect.
I appreciate your help.
-----Message d'origine-----
De : midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de lgoodbar@xxxxxxxxxxxxxx
Envoyé : jeudi 9 octobre 2008 15:05
À : midrange-l@xxxxxxxxxxxx
Objet : RE: REXX QIBM_REX_FIND_SRCMBR
Can you share the exact command entered, and the value of iSql that REXX sees? Have you tried the SQL in Navigator or RUNSQL to verify the syntax?
Also, you may need to specify immediate execution depending on what the statement is (select versus insert or update):
EXECSQL "execute immediate "iSql
I don't do dynamic SQL in REXX so that's all I can think of.
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: Thursday, October 09, 2008 7:51 AM
To: Midrange Systems Technical Discussion
Subject: RE: REXX QIBM_REX_FIND_SRCMBR
Having some difficulty with that.
My working REXX procedure permits me to pass and execute an sql instruction.
Now I've created a command that directly invokes REXX.
I parse the argument so :
PARSE ARG 'CMD('iSql')'
SAY iSql shows me that the parsing has taken place, but
ADDRESS EXECSQL,
EXECSQL iSql
Sends the error SQL0104 which is a syntax error.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.