Dynamic SQL is a programming technique that enables you to build SQL statements dynamically at runtime.
You 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 lets you create a procedure that operates on a table whose name is not known until runtime.
Oracle includes two ways to implement dynamic SQL in a PL/SQL application:
- Native dynamic SQL, where you place dynamic SQL statements directly into PL/SQL blocks
- Calling procedures in the DBMS
_SQLpackage.