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



That workaround has always seemed a little ugly to me - counter-intuitive when all you want is the output of a SELECT statement. Like take a left at Denver to go from Minnesota to Iowa.

JMHO

Vern

On 11/14/2012 5:05 PM, Sam_L wrote:
In defense of not supporting SELECT, there is quite a bit more coding
effort to provide support for where the output of the select goes to.

Now this variation on Rob's select does work:

RUNSQL SQL('create table qtemp/zz_table as (SELECT SYSTEM_TABLE_SCHEMA,
count(*) as the_count FROM syscolumns WHERE system_table_schema=''QIWS''
GROUP BY SYSTEM_TABLE_SCHEMA) with data') COMMIT(*NONE)

Basically it amounts to adding a create table and giving a name to the
count(*) column.

And you can also do the same kind of thing with RUNSQLSTM.

Sam

On 11/14/2012 8:17 AM, rob@xxxxxxxxx wrote:
Does RUNSQL support a simple select? When I run this:
runsql 'SELECT SYSTEM_TABLE_SCHEMA, count(*)
FROM syscolumns WHERE system_table_schema=''ERPLXF''
GROUP BY SYSTEM_TABLE_SCHEMA'

I get nothing. Nothing returns to my screen. No joblog information.
Nothing.
Command Entry
CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)
runsql 'SELECT SYSTEM_TABLE_SCHEMA, count(*)
FROM syscolumns WHERE system_table_schema=''ERPLXF''
GROUP BY SYSTEM_TABLE_SCHEMA'

But this works fine
runsql 'CREATE TABLE ROB/NATHANs (WTF CHAR (5 ) NOT NULL WITH DEFAULT)'
Ownership of object NATHANS in ROB type *FILE changed.

Guess not:
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fsqlp%2Frbafyrunsql.htm

What a major disappointment. In the stuff that uses wrap arounds for
STRQMQRY you can use a simple select. But when I tried to write a
imbedded sql in RPG type solution I think I had the same limitation that a
simple select (without an into or some such thing) wouldn't work. IBM
probably ran into the same thing. I guess there's still situations for
the renamed command I use to run an sql statement.



Rob Berendt



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.