Because there's nothing for it to use to display the results. RUNSQLSTM should be used to create tables, create views, insert, update or delete data. There's probably a lot of other things you can use it for, but select is not one of them.

As for strqmqry, I would imagine that to override the print file.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of ADriver@xxxxxxxxxxxx
Sent: Friday, September 30, 2011 1:05 PM
To: midrange-l@xxxxxxxxxxxx
Subject: SQL/QMQRY output question


Hi,

I'm trying to set up some audit reports using QMQRY but I'm having some trouble with the output. Using a QMQRY with *SYSDFT as the QMFORM it chops up the output into several spool files, which I don't want. If I try to define a QMFORM it tells me the number of columns must match the number of fields selected, which would mean I would have to create a form for each query. I'm hoping to be able to just create one form and use it for a bunch of queries. Is there any way to do this so it accepts any number of fields/columns but leaves the printed output as one spool file?

BTW, I'm using QMQRY because of an error I can't work out if I use RUNSQLSTM. I get the following error when I try:

5761SS1 V6R1M0 080215 Run SQL Statements AUDSPECAUT 09/30/11 11:47:44 PAGE
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
1 SELECT UPUPRF, UPUSCL, UPPWON, UPPSOD, UPTEXT, UPSPAU FROM
2 WEADPD.USRPRFP WHERE UPSPAU <> '*NONE' AND UPUPRF NOT LIKE 'Q%'
* * * * * E N D O F S O U R C E * * * * *
5761SS1 V6R1M0 080215 Run SQL Statements AUDSPECAUT 09/30/11 11:47:44 PAGE
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
MSG ID SEV RECORD TEXT
SQL0084 30 1 Position 1 SQL statement not allowed.

As you can see this is a very simple statement and if I just run the same statement from a STRSQL screen it's fine. (I am running the RUNSQLSTM command with *SQL naming too).

Does anyone has any ideas on either the error with RUNSQL or how to fix the output for QMQRY without creating a form for each query?

Thanks in advance

Adam Driver
IBM Certified Systems Administrator - System i Consultant - Infrastructure Technician Exacta Corporation
608.661.6697 ext 2581
adriver@xxxxxxxxxxxx<mailto:adriver@xxxxxxxxxxxx>
Please consider your environmental responsibility before printing this e-mail.



[Like us on Facebook!]<http://www.facebook.com/#!/pages/WEA-Insurance-Trust/199543713420728>

- WEA Trust Confidentiality Notice -

This electronic mail message and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. Dissemination, forwarding, printing, or copying of this electronic mail without the consent of the sender is strictly prohibited. If you are not the intended recipient or the person responsible for delivering the electronic mail to the intended recipient, be advised that you have received this electronic mail in error; please immediately notify the sender by return mail.
________________________________

Notice from Bob Evans Farms, Inc: This e-mail message, including any attachments, may contain confidential information that is intended only for the person or entity to which it is addressed. Any unauthorized review, use, disclosure or distribution is strictly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.

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.