Optimization when SQL is within an SPL routine
If an SPL routine contains SQL statements, the database server optimizes and executes the SQL within the SPL routine.
The topics in this section contain information about how and when the database server optimizes and executes these routines.