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
 

 

Difference bitween Static and Dynamic SQL.

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

New User


Joined: 28 Jul 2005
Posts: 5

PostPosted: Thu Aug 04, 2005 3:20 pm    Post subject: Difference bitween Static and Dynamic SQL.
Reply with quote

Hi All,


What is the Difference bitween Static and Dynamic SQL.


Regards,
Murali.
Back to top
View user's profile Send private message

ashokkumarsahu

New User


Joined: 03 Aug 2005
Posts: 6
Location: bangalore

PostPosted: Thu Aug 04, 2005 3:34 pm    Post subject:
Reply with quote

In case of static call goth the called program and calling program are loaded into main memory at atime but in case of dynamic call called program is loaeded at the time of call only .
Back to top
View user's profile Send private message
sravani

New User


Joined: 17 Jul 2005
Posts: 3

PostPosted: Thu Aug 04, 2005 9:23 pm    Post subject: Re: Difference bitween Static and Dynamic SQL.
Reply with quote

Hi,

A static SQL is hard coded in the program/stored proc when the the columns and conditions to be used are fixed.

Dynamic SQL is used when the query need to be midfitied based on different conditions.

Preparing the dynamic SQL:
EXEC SQL
PREPARE DYNAMIC_CSR <Dynamic_Cursor_Name>
FROM :WS-DYNAM-SQL-AREA <working storage area definitions>
END-EXEC

Regards,
Sravani
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Tue Aug 09, 2005 10:37 am    Post subject:
Reply with quote

Hi,

I would like to add one more point. Static SQL is bound at program preparation time whereas dynamic SQL is bound at run time. Which of course has lesser performance than static SQL.
Back to top
View user's profile Send private message
niranjan.sinha@gmail.com

New User


Joined: 16 Aug 2005
Posts: 1

PostPosted: Tue Aug 16, 2005 2:13 pm    Post subject: Diff. Between Static and Dynamic Call
Reply with quote

1) For Static Call we use Compiler option NODYNM, But Dynamic Call we use Compiler option DYNAM.

2) For Static Call load module is very large,but for Dynamic call load module size is very small.

3) For Static call access path is created while compiling, but for Dynamic call access path is created at run time.
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm


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