If that may help, it looks like the command length is wrong and the string null gets read
Additional Message Information
Message ID . . . . . . : CPD0018
Date sent . . . . . . : 02/16/21 Time sent . . . . . . : 14:46:41
Message . . . . : String ') ' contains a character that is not
valid.
Cause . . . . . : The string contains a character that is only valid in a
quoted string or a comment.
Recovery . . . : Remove the character that is not valid from string
X'5D000000000000000000', or if it is a parameter value, make the string a
quoted string. More information on valid characters can be found in the
Information Center.
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Francois Lavoie
Sent: Tuesday, February 16, 2021 14:07
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: How many quotes does it need to work?
We have to create a user profile remotely on a remote partition So, Im using QCMDEXC inside a RUNSQL which works perfectly fine for all commands except when the command has a parm with single quotes
Any help would be much appreciated
Thanks in advance
Here are some examples: (copy and paste to Notepad for a better formatting)
I tried single, double and quadruple quotes around the TEXT parm to no avail Throwing SQL0443 Trigger program or external routine detected an error
....5...10...15...20...25...30...35...40...45...50...55...60
'RUNSQL SQL('CALL ISALE03/QSYS2/QCMDEXC(''CRTUSRPRF USRPRF(FL'
'Z ) PASSWORD(*USRPRF) PWDEXP(*YES) USRCLS(*PGMR ) '
'TEXT(''''fla'''') GRPPRF(*NONE) OWNER(*USRPRF) SUPGRPPRF(*NO'
'NE) SPCAUT(*ALLOBJ *JOBCTL *SPLCTL)'',170)') COMMIT(*NONE) N'
'AMING(*SYS) OPTION(*NOLIST) '
Below example works perfectly fine
....5...10...15...20...25...30...35...40...45...50...55...60
'RUNSQL SQL('CALL ISALE03/QSYS2/QCMDEXC(''DSPUSRPRF USRPRF(MA'
'RCEL ) TYPE(*BASIC) OUTPUT(*OUTFILE) OUTFILE(QGPL/@@@USRP'
'RF) OUTMBR(*FIRST *REPLACE)'',106)') COMMIT(*NONE) NAMING(*S'
'YS) OPTION(*NOLIST) '
This one as well:
....5...10...15...20...25...30...35...40...45...50...55...60
'RUNSQL SQL('Insert Into RSDFF02 Select ''ISALE03'',UPUPRF,UP'
'USCL,UPPWON,UPPSOD,UPPSOT,UPGRPF,UPTEXT,'' '',UPSTAT,'' '' F'
'rom ISALE03/QGPL/@@@USRPRF') COMMIT(*NONE) NAMING(*SYS) OPTI'
'ON(*NOLIST) '
Confidentiality Warning/Avertissement de confidentialit?:
This message is intended only for the named recipients. This message may contain information that is privileged or confidential. If you are not the named recipient, its employee or its agent, please notify us immediately and permanently destroy this message and any copies you may have. Ce message est destin? uniquement aux destinataires d?ment nomm?s. Il peut contenir de l'information privil?gi?e ou confidentielle. Si vous n'?tes pas le destinataire d?ment nomm?, son employ? ou son mandataire, veuillez nous aviser sans tarder et supprimer ce message ainsi que toute copie qui peut en avoir ?t? faite.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
Confidentiality Warning/Avertissement de confidentialité:
This message is intended only for the named recipients. This message may contain information that is privileged or confidential. If you are not the named recipient, its employee or its agent, please notify us immediately and permanently destroy this message and any copies you may have. Ce message est destiné uniquement aux destinataires dûment nommés. Il peut contenir de l'information privilégiée ou confidentielle. Si vous n'êtes pas le destinataire dûment nommé, son employé ou son mandataire, veuillez nous aviser sans tarder et supprimer ce message ainsi que toute copie qui peut en avoir été faite.
As an Amazon Associate we earn from qualifying purchases.