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



An interesting thought, Justin - the evidence of the I-specs that the pre-compiler adds suggests you are right.

Now that also suggests to me that, if one uses SELECT *, then, if columns are added, they will not be seen - no I-spec for the new columns.

Or is this just a Monday-morning fancy I'm going through?

Cheers
Vern

On 5/4/2020 10:15 AM, Justin Taylor wrote:
Unless I'm mistaken, the pre-compiler resolves the SELECT * at compile-time, so the result is the same as explicitly listing the columns.


-----Original Message-----
From: David Gibbs via RPG400-L [mailto:rpg400-l@xxxxxxxxxxxxxxxxxx]
Sent: Friday, May 01, 2020 12:34 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: David Gibbs <david@xxxxxxxxxxxx>
Subject: Re: Implicitly hidden column & EXTNAME D/S

On 5/1/20 12:19 PM, Justin Taylor wrote:
" BTW it is never a good ide to use SELECT *!"

Personally, I'd say "almost never". Can you explain why it's better
for the SELECT (in static SQL) to explicitly list every single column
rather than doing SELECT *?
If a table's structure changes, and you're retrieving into host variables, you will be either missing variables, have too many, or have mismatches.

As Brigitta says, better to list every column you want to retrieve so there is little risk of mismatch.

david


--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax-deductible donation to my ride by visiting https://mideml.diabetessucks.net.

You can see where my donations come from by visiting my interactive donation map ... https://mideml.diabetessucks.net/map (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!



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.