var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: static and dynamic sql.......help
Does any one have a link or a document on the difference between a static and a dynamic SQL.
Can you please give me an example for both?
A static SQL statement is one whose access path can be decided by the optimizer at bind time
The optimizer will not know the access path at bind time for dynamic SQL .
SELECT col5 from tab1 where col1=<var>
Here the optimizer knows that it has to access tab1 to select col5 and the filtering is based on col1. So it can decide the best access path and is the access path does not change ie 'static' .
SET tabname1='tab1' ;
SET pred1='col1=100' ;
SET stmt1='select col9 from '||tab1||' where ' || pred1 ;
EXECUTE IMMEDIATE stmt1 ;
Here the values of tab1 and pred1 are not known until the runtime and therefore the optimizer chooses the access path 'dynamicaly' at runtime
Look at the appl dev guide in the db2 documentation
Originally Posted by db1db2
Visit the new-look IDUG Website
, register to gain access to the excellent content.
Thanks a lot,sir.
Iam a dba in making ,and i always had this doubt.