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 role of schema in the db2 database?

945


How can you find out the # of rows updated after an update statement?

886


How to take backup of table in db2?

836


How do you simulate the explain of an embedded sql statement in spufi/qmf?

872


What is a dbrm in db2?

793


What is the use of dclgen in db2?

825


What is a trigger in the db2 database?

841


How to find the maximum value in a column in the db2 database?

855


What is db2 stogroup?

918


What is meant by dclgen?

892


What is cursor in dbms?

853


How can we retrieve the total number of records in RPG & CLLE?

409


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

941


in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?

1870


what is db2 restart?

1934