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



On 26-May-2010 16:58, 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


As others have noted, the *QMQRY can have only one statement. However I did not see where anyone suggested that the CREATE TABLE can combine them, effectively, using SELECT. For example...

Issue CRTQMQRY QTEMP/FILEMSG using the following as QMQRY source:

create table qtemp/filemsg as ( select
char('Job exceeded max run min of'
concat &MAXRUN ,128) as msg
from qsys2/qsqptabl ) with data

Then issue for example, the following request to run the query with the variable substitution:

strqmqry QTEMP/FILEMSG setvar((maxrun '2.5'))

Verification by RUNQRY *N QTEMP/FILEMSG shows:

Line ....+....1....+....2....+....3....+.
MSG
000001 Job exceeded max run min of 2.5
****** ******** End of report ********

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.