Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us