Will the new IBM RUNSQL command offer any improvements into building the SQL command string? Ie stringing CL variables together with SQL statements?
Or will it still require stuff like:
CHGVAR &SQLCMD ('INSERT INTO LGFILE +
(LG_CLIENT, LG_SEQ, LG_DATE, LG_TIME, LG_DIR, LG_ID, +
LG_MODE, LG_NRECS, +
LG_ERRCDE, LG_TYPE, LG_FORMAT, LG_SOURCE, LG_TARGET, +
) VALUES (' *tcat +
&QT *cat &P_CLIENT *cat &QT_C *cat +
&QT *cat &P_SEQ *cat &QT_C *cat +
&QT *cat &CUR_YYYYMD *cat &QT_C *cat +
&QT *cat &CUR_HHMMSS *cat &QT_C *cat +
&QT *cat &P_DIR *cat &QT_C *cat +
&QT *cat &P_ID *cat &QT_C *cat +
&QT *cat &MODE *cat &QT_C *cat +
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jack Callahan
Sent: Saturday, May 12, 2012 12:23 AM
Subject: Re: easier SQL statements in CL
But what the OP is really complaining about is the relative inelegance of
creating a string in CL that contains variables and single quotes- and the
SQL statement he needs to build requires vairables and single quotes.
I suggested solution to create the string using RTVMSGD several weeks ago,
although I admit it's not directly obvious what the created string will
look like when examining the CL.
Perhaps he should consider embedding the SQL in his RPG/COBOL program,
rather than using it as an OPNQRYF replacement.