IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we use select * in the embeded sql


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjunathkv

New User


Joined: 23 May 2006
Posts: 9

PostPosted: Thu Sep 11, 2008 1:15 pm
Reply with quote

can we use select * in cobol program?

Thanks in advance
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Sep 11, 2008 1:58 pm
Reply with quote

Yes.

But it is not advisable since we would not need all columns. It creates an overhead.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Sep 11, 2008 2:06 pm
Reply with quote

Manju,

Your Subject and the contents in the post are not the same.

Quote:
Can we use select * in the embeded sql


Quote:
can we use select * in cobol program?


Anyways, it is not advisable to use as you may face issues when the table structure gets changed .
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Sep 11, 2008 2:18 pm
Reply with quote

Manjunath,

From the manual.

Quote:
SELECT * is recommended mostly for use with dynamic SQL and view definitions. You can use SELECT * in static SQL, but this is not recommended; if you add a column to the table to which SELECT * refers, the program might reference columns for which you have not defined receiving host variables
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts How can I select certain file dependi... JCL & VSAM 12
Search our Forums:

Back to Top