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

In cobol+DB2program if the code of cobol program has changed than i have to do precompilation once again?

6 Answers   TCS,


What is ALTER ?

3 Answers  


Explain an outer join?

1 Answers  


what is main use of table space and index object? please its urgent

5 Answers   CA, Cap Gemini, CGI, CTS, EDS, HTC, IBM, Satyam, Syntel, TCS, Wipro,


Usually, which is more important for DB2 system performance - CPU processing or I/O access?

1 Answers  






When do you use the IMAGECOPY?

4 Answers  


What is the difference between oracle and db2?

0 Answers  


How we create a tables in db2,what is the process/syntax to create a table with example plz?

2 Answers  


What is a clustering index ?

3 Answers  


is it possible to get -811 error when you use cursors. why?

2 Answers   IBM,


How can you validate Sql errors during cursor operation in db2 pgms and where do you code?

0 Answers   IBM,


how can we find nth max salary from A table

5 Answers   IBM,


Categories