What is the difference between static and dynamic SQL?



What is the difference between static and dynamic SQL?..

Answer / 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

More DB2 Interview Questions

select 100 records from million records ?

2 Answers   Verizon,


max number of columns in a db2 table?

6 Answers  


what is the responsibility of the construction superintendent

0 Answers   Almco,


Can SQL statements/queries be included in a copybook?

2 Answers  


What type of database is db2?

0 Answers  






How can you split a table in to exactly half?

7 Answers   HSBC,


what is rebinding ?

1 Answers   IBM,


What do you mean by NOT NULL WITH DEFAULT? When will you use it?

3 Answers  


What is load utility in db2?

0 Answers  


My SQL is not performing well. Describe how will you fine tune it?

1 Answers   Accenture,


How to resolve -504 sql code in DB2?

2 Answers   Cap Gemini,


On which levels locks can be applied?

0 Answers  


Categories