What is the difference between static and dynamic SQL?

Answer Posted / jkb

In Stats SQL, the statement is prepared before the program
is executed and the operational form of the statement
persists beyond the execution of the program. A source
program containing static SQL statements must be processed
by an SQL precompiler before it is compiled. The
precompiler checks the syntax of the SQL statements, turns
them into host language comments, and generates host
language statements to invoke DB2.


A dynamic SQL statement is prepared during the execution of
an SQL application, and the operational form of the
statement is not persistent. The source form of the
statement is a character string passed to DB2 by an
application program using the static SQL statement PREPARE
or EXECUTE IMMEDIATE.

Is This Answer Correct ?    52 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of with ur in db2?

625


What is reorg?

624


Define db2 and its databases?

628


How do I copy a table in db2?

579


can we view the access paths created by dbrm ? how ? thx

6269






can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well

1812


What is check constraint. Explain with example.

652


What is query_cache_limit?

551


What is cobol db2?

572


How can you do the explain of a dynamic sql statement?

639


What is a system catalog table in db2?

592


What is the result of open cursor statement?

642


What is the maximum No of rows per page?

635


What is temporal table in db2?

607


How do I connect my db2 database to ibm?

607