As you have seen in this chapter, dynamic SQL can be used for executing SQL statements that are not fully known until runtime. Dynamic SQL can be used for single SQL statements, the CALL statement (except in zSeries), and cursors. Such features enhance the flexibility and add more robustness to SQL procedures. You have seen when and how to use the EXECUTE IMMEDIATE, PREPARE, and EXECUTE statements.
Additionally, the use of an escape character in dynamic SQL statements was explained. The package cache and how it is used to improve performance of dynamic SQL was discussed indepth. Finally, special registers that can be used to improve performance and further control the environment were examined.