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



-----Original Message-----
From: Phil <sublime78ska@yahoo.com>
To: rpg400-l@midrange.com <rpg400-l@midrange.com>
Date: Friday, September 14, 2001 11:35 AM
Subject: RE: SQL Problem


>I use * because it reduces typo's, and often I need the entire record
>anyway.  You're saying, though, that this is a shortcut which I may pay for
>later.  (and I probably saw it in a manual early on.)

yup, it's a pay me now or pay me later....

>Originally I was using SQLCOD to check for errors, etc, and have switched
to
>using SQL State because of recommendations from this list - probably from
>you.

I don't know if it was me specifically, but it is well known by many who
work on multiple databases, that about the only SQLCODE value that one can
rely on is 100. The rest are usually implementor defined with some matches,
some similarities. The SQLSTATE value is usually consistent, particularly
across all implementations of DB2, which do not have the SQLCODEs in all of
them.

>I did this test:  I created a file with 3 fields, and wrote an rpg pgm with
>embedded sql to select * from file into :hostds.  The hostds is an external
>ds.  Then I added a field to the file, and ran the program again (without
>recompiling).  The hostds, which still contained only 3 fields, was
inserted
>correctly.  The fourth field was ignored or dropped apparently.  So I'm
>still confused as to why it's bad to use *.


So, was the fourth field character? What happens if you change the
attributes of a field, say the second field in the file, from a packed
decimal 9.2 to 11.2? What happens if you add a field that is binary?

What happens with a select * into :ds after you add the field? Are there any
field definitions after the data structure map? What happens to those
fields?

===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - AS/400 Administrator
 -- IBM Certified Specialist - RPG IV Developer

"America is the land that fought for freedom and then
  began passing laws to get rid of it."

     - Alfred E. Neuman




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.