× 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.



I'm going to guess no, but in some cases you might be able to simplify by declaring &P_CLIENT, &P_SEQ etc as *BASED fields of a longer character variable thus building the VALUES( clause there. It could look as simple as VALUES(&VALUES) avoiding all those *cats in your program.

- Larry "DrFranken" Bolhuis

On 5/14/2012 10:41 AM, Stone, Joel wrote:
*This message was transferred with a trial version of CommuniGate(r) Pro*
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, +
LG_JOBID +
) 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 +

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jack Callahan
Sent: Saturday, May 12, 2012 12:23 AM
To: midrange-l@xxxxxxxxxxxx
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.

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.