T-REXDB2
New User
Joined: 28 Apr 2005 Posts: 11 Location: USA
|
|
|
|
sunil_chappy wrote: |
why select * not used in embeded sql |
Hello to you, Sir, Sunil_chappy:
Yes, " SELECT * " may be used in a host program, containing imbedded SQL DML statements. That is truly a given.
It is grave mis-conception that " SELECT * " cannot be imbedded within a host program. It may be imbedded, just like any other SELECT explicit COLUMN statement would be.
What you must know is, it is bad practice to imbed a "SELECT *" into a host program because if additional columns are added to the structure you are selecting from, then the program fails because the number of columns the program was expecting DB2 to return will have increased and will, most likely, not be handled correctly by the host program logic code.
Again, by eliminating " SELECT * " and only specifying exact columns, in your SELECT, future structure changes will not, negatively, impact the execution of the host program. Although, the program would have to be modified to include any/all newly added column(s) to said structure(s).
Thank you and hope this helps, muchly!
;-] |
|