Dynamic SQL And Embedded SQL
Dynamic SQL What is Dynamic SQL? Dynamic SQL is a programming technique that is used to build SQL statements dynamically at runtime. One can create more general purpose, flexible applications by using dynamic SQL because the full text of a SQL statement may be unknown at compilation. For example, dynamic SQL allows to create a procedure that operates on a table whose name is not known until runtime. Why need Dynamic SQL? Dynamic SQL enables us to write programs that reference SQL statements whose full text is not known until runtime. The simple statements which we use are known as static SQL statements. Static SQL statements do not change from execution to execution. The full text of static SQL statements are known at compilation, which provides the following benefits: Successful compilation verifies that the SQL statements reference valid database objects. Successful compilation verifies that the necessary privileges are in place to access the database objects. Performance of st...