Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Select statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sunil_chappy

New User


Joined: 19 Mar 2006
Posts: 9
Location: Bangalore, INDIA

PostPosted: Fri Mar 24, 2006 7:39 pm    Post subject: Select statement
Reply with quote

why select * not used in embeded sql
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Mar 24, 2006 10:43 pm    Post subject: Re: Select statement
Reply with quote

http://ibmmainframes.com/viewtopic.php?t=9847

Regards,
Priyesh.
Back to top
View user's profile Send private message
T-REXDB2

New User


Joined: 28 Apr 2005
Posts: 11
Location: USA

PostPosted: Sun Mar 26, 2006 4:00 am    Post subject: Re: Select statement
Reply with quote

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!

;-]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us