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



There is no substitution-variable capability in RUNSQLSTM. I find the process described here to be lacking in that you have to create the source member again to work with a different table or with different selectivity.

Also, you end up with at least 2 source members to accomplish the task - one for the CL that does the RUNQRY, etc., the other for the script. This just feels more complicated than a single command that has a parameter for OUTPUT, say, just as STRQMQRY has.

Now all the QMQRY-based SQL processors also do not have substitution variables - well, they have ONLY substitution variables in the inner processing level, but we don't see that.

I admit some difficulties with embedded apostrophes - it is not onerous, in my opinion. And the trade-off is well worth it in my experience.

Now maybe I can convince Mark A. that SELECT should be allowed in the new RUNSQL!

Regards

On 3/29/2013 3:09 PM, CRPence wrote:
On 28 Mar 2013 21:08, Vernon Hamberg wrote:
RUNSQL has the same limitation as RUNSQLSTM - it will not run
a SELECT statement. I find being able to run a SELECT from a
command line to be so helpful, that I'll probably always keep
a command based on QMQRY for that purpose.
While the command interface to a *QMQRY to effect the request can be
nice, requesting the invocation of that CL request within the RUNSQLSTM
is not very nice IMO; too much escaping of apostrophes.

I would usually just encapsulate the SELECT in either a VIEW or a
CREATE TABLE ... AS and then issue a RUNQRY. Within a RUNSQLSTM by
invocation of the CL interpreter, either via the general request to CALL
QCMDEXC('RUNQRY ...', 00000000##.00000) or via a custom request to CALL
EXECCMD ('RUNQRY ...') to eliminate the 15P05 command-string length
parameter.

I had at one time utilized a private variation of the RUNSQL command
that would automatically encapsulate a given SELECT in that manner [as
described above; TABLE or VIEW in QTEMP], and then automatically issued
the CL request to the RUNQRY, followed by a DROP VIEW or DROP TABLE for
that which was created in QTEMP for use by the RUNQRY
QRYFILE((QTEMP/the_name)) request.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.