O'Reilly logo

DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition by Paul Yip, Fraser McArthur, Michael Gao, Raul Chong, Drew Bradstock, Clara Liu, Zamil Janmohamed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Working with Dynamic SQL

In this chapter, you will learn

  • The two phases of processing an SQL statement

  • The difference between dynamic SQL and static SQL

  • When and how to use dynamic SQL with the EXECUTE IMMEDIATE statement

  • When and how to use dynamic SQL with PREPARE and EXECUTE

  • The use of dynamic SQL in cursors

  • How to use dynamic CALL statements

  • The use of dynamic SQL for DDL

  • How to use the escape character in dynamic SQL

  • How to use the package cache

Dynamic SQL is a method of SQL programming that allows you to write robust and flexible code. So far, only static SQL has been used in our SQL procedures, and the distinction between dynamic SQL and static SQL has not been made. At this stage, you may not even know that SQL can be classified as static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required