It's good that you don't want to use SELECT *

But you also should not need "every column" very often if at all. (And the
exceptions where you do need every column might actually be an exception to
the don't use SELECT * rule)

Best practice in the SQL world is to only SELECT the columns you actually
need.

I've got a little routine that generates an RPG data structure from
SYSCOLUMNS, once you've got a full DS someplace, getting just the subfields
you need isn't a big deal. Maybe I'll clean it up and post it someplace...

For the SELECT, prompting in ACS RSS is usually my quickest way of getting
a list.


Charles

On Fri, Mar 21, 2025 at 2:09 PM x y <xy6581@xxxxxxxxx> wrote:

Instead of SELECT * or listing every column name, I'd like to put the
column names in a source member and "include" it in the main SQLRPGLE
compile. The source members are machine-generated; I'm doing this to
reduce the maintenance workload.

"from_src" is "a,b,c". "into_src" is ":a,:b,:c".

INCLUDE works with SELECT:
SELECT
INCLUDE from_src
INTO...

but the preprocessor won't accept
INTO
INCLUDE into_src
WHERE...

The error is SQL0104 and the preprocessor is looking for a comma or an
INTO. I have my INCFILE set correctly.

Using
FETCH NEXT FROM THIS_CURSOR INTO
into_src...

INCLUDE is tagged as a variable not found.

Am I missing something other than using dynamic SQL? It's just a reminder
of how incredibly productive DDS is!
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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