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



Hi Bryan

I can run multiple SQL statements so that might be a handy approach even if
not for this particular situation.
That snippet could be useful for some other things I am working on.

On Thu, Jul 26, 2018 at 6:35 AM, Bryan Dietz <bdietz400@xxxxxxxxx> wrote:

if you can run multiple SQL statements, I wonder if the following would
run better:

CREATE or replace VARIABLE sysname VARCHAR(8);
SET sysname=(SELECT varchar(gdes)
FROM QPFRDATA.QAPMCONF where GKEY = (' S'));
SELECT sysname, i.* FROM qiws.qcustcdt i;

Bryan





Evan Harris wrote on 7/22/2018 6:41 PM:

Hi all

I am running some SQL queries to extract data and thought that adding a
"system" column to the extracted would be a good idea, rather than trying
to keep track of it in the file name, or having it hardcoded in the query.

So, for example, I have an SQL Statement as follows:

SELECT INTNUM,
(SELECT HOST_NAME FROM QSYS2.SYSTEM_STATUS_INFO) as SYSNAME
FROM QPFRDATA.QAPMSYSTEM

Which returns a bunch of SYSNAM and INTNUM columns.

My question is, is this the most efficient/best practise way of doing this
? I am wondering if running it this way will cause the query to be
executed
for every row that gets returned.

What other ways are there that might be preferable or more efficient ?

--
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: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD





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.