I am trying to use the RUNSQLSTM command. I get the error message "statement not allowed"
Not really trying anything fancy.
In CL program
RUNSQLSTM SRCFILE(jwe/QCLSRC) SRCMBR(SQL1) +
COMMIT(*NONE)
In SQL1 I have
SELECT mstid,
SUBSTR(ftxref,1,1) AS ftxref_1,
SUBSTR(HEX(SUBSTR(ftxref,2,7)),1,9) AS char,
ftext,
ftxtno
FROM MEDPDATA/ftxp010
WHERE SUBSTR(ftxref,1,1) NOT IN ('A','M')
AND ftxref NOT IN (SELECT scrcod
FROM tabp160)
UNION
SELECT mstid,
SUBSTR(ftxref,1,1) AS ftxref_1,
SUBSTR(ftxref,2,7) AS char,
ftext,
ftxtno
FROM MEDPDATA/ftxp010
WHERE SUBSTR(ftxref,1,1) IN ('A','M')
AND ftxref NOT IN (SELECT scrcod
FROM tabp160)
Oops, I hadn't noticed that it was a SELECT from RUNSQLSTM, I thought it was an embedded SELECT.
So I guess this'll work OK from STRSQL.
Dave is right, RUNSQLSTM doesn't know what to do with output from a SELECT.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply