|
Yeah, I almost always go with a QMQRY for just that reason. Maybe SQL
scripts are useful for building the database, though.
By the way, there is also a thing called a QMPROC that lets you execute
other QM things in it - looked at them years ago and have never quite
gone there. STRQMQRY with SERVARs is just too handy in CL.
Later
Vern
Jerry Draper wrote:
Thanks.--
I actually need to use QMQRY because I want to pass variables from CL to
the qry.
J
On 5/26/2010 3:15 PM, Vern Hamberg wrote:
QM can process only one SQL statement per QMQRY object. If you want to
do multiples like this, you either need 2 QMQRYs, or you should use
RUNSQLSTM against a source member.
QM uses objects - queries and forms. RUNSQLSTM uses members.
Why use QM instead of RUNSQLSTM? For one thing, you can have
substitution variables. And you are not limited as to the statements you
can use. E.g., you can't use a simple SELECT statement with RUNSQLSTM.
But it looks like you want to use RUNSQLSTM, so one thing you might do
is run these in STRSQL, then save the session to a source member, strip
out all the stuff you don't want, put semi-colons at the end of EACH
statement, and there you are.
HTH
Vern
Jerry Draper wrote:
I am using STRQM to create a simple SQL script.
CREATE TABLE QTEMP/FILEMSG
(MSG CHAR (128 ) NOT NULL WITH DEFAULT)
INSERT INTO QTEMP/FILEMSG (MSG)
VALUES ('Job exceeded max run min of&MAXRUN')
I get :
Keyword INSERT not expected. Valid tokens:<END-OF-STATEMENT>
Is there some kind of end of stmt required for STRQM that is not
required in STRSQL where this script works fine?
I tried it with semi-colon and got same results
Jerry
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.