< Day Day Up > |
IN THIS CHAPTER
In Chapter 11, "Using DB2 in an Application Program," you learned about embedding static SQL into application programs to access DB2 tables. As you may recall from Chapter 1, "The Magic Words," though, you can embed another type of SQL in an application program: dynamic SQL. Static SQL is hard-coded, and only the values of host variables in predicates can change. Dynamic SQL is characterized by its capability to change columns , tables, and predicates during a program's execution. This flexibility requires different techniques for embedding dynamic SQL in application programs. Before you delve into the details of these techniques, you should know up front that the flexibility of dynamic SQL does not come without a price. In general, dynamic SQL is less efficient than static SQL. Read on to find out why. |
< Day Day Up > |