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

Dynamic SQLs


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

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Tue May 05, 2009 9:00 pm
Reply with quote

Is it a safe assumption to say that any dynamic SQL will have "PREPARE" and/or "EXECUTE" keyword in it???
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 06, 2009 2:20 pm
Reply with quote

PREPARE is a must but not EXECUTE.

If the query is fixed and no changes are required in future like column additons then PREPARE is enough, otherwise EXECUTE is a must
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Wed May 06, 2009 11:15 pm
Reply with quote

Hi

Quote:
PREPARE is a must but not EXECUTE.


We can not come to a conclusion like this without going thru the requirement of the program. If the Dynamic Sql program is for NON-SELECT, we can say EXECUTE is a must not PREPARE. If it is Parameterized NON-SELECT, we need both PREPARE and EXECUTE. For Fixed list SELECT and Variable List SELECT, we do not need the EXECUTE statement but PREPARE is required.

Regards
Raghu
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 Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts Dynamic file allocation using JCL JCL & VSAM 8
No new posts Dynamic Sortin DD cards SYNCSORT 8
Search our Forums:

Back to Top