Chapter 12. Dynamic SQL Programming

 <  Day Day Up  >  

IN THIS CHAPTER

  • Dynamic SQL Performance

  • Dynamic SQL Guidelines

  • Reasons You Should Know Dynamic SQL

  • EXECUTE IMMEDIATE

  • Non-SELECT Dynamic SQL

  • Fixed-List SELECT

  • Varying-List SELECT

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  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net