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



Waldon,

Actually, I was under the apparently mistaken impression that you would have to recompile since you'd
be changing the number of columns being returned and thus the number of variables you'd need to hold
the returned data.

However, a quick test shows that at least with a SELECT INTO that doesn't appear to be the case; but
only as long as the column is added to the end of row.

RPG retrieves data by ordinal position in the results set, it apparently doesn't care if there's more
columns than it was expecting.

Dropping a column would be a bad idea; but probably not a real concern.

Somewhere, someone said that using SELECT * in a production application was a bad idea. IIRC, that
was a recommendation to follow no matter what DB or what language was involved but I thought it really
was applicable to RPG. A quick google search, turns up at least one result. The following reasons
apply to using SELECT * and any DB and language:
1) extra unneeded data returned
2) doesn't allow index-only access
3) Stability - applications could be accessing via ordinal position instead of column name.

Point 3 is the is important to us since RPG with embedded SQL always uses ordinal position.

So I've learned that SELECT * doesn't have to mean a recompile, but I think I'll still continue
specifying specific columns names in most cases.

Charles



-----Original Message-----
From: midrange-l-bounces+wiltc=cintas.com@xxxxxxxxxxxx
[mailto:midrange-l-bounces+wiltc=cintas.com@xxxxxxxxxxxx] On
Behalf Of Walden H. Leverich
Sent: Tuesday, September 11, 2007 6:59 PM
To: Midrange Systems Technical Discussion
Subject: RE: CREATE INDEX and name only some columns

1) Better performance
2) You can change the DB without needing to recompile all
the program.

I'm with you on #1 & #2 for DDS/LF, but since you say "same
reason you'd..." you seem to imply that both cases are true
in SQL too. I can see #1, but #2 isn't true, is it? If I
"select * from..." in an RPG program I can still change the
underlying table w/out a recompile, can't I?

-Walden

--
Walden H Leverich III
Tech Software
(516) 627-3800 x3051
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)


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




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.