The EXEC_SQL
package is particularly useful when you need to retrieve
result sets from different data sources into one report.
To process a statement that returns a result set:
For each column, use EXEC_SQL.DEFINE_COLUMN
to specify the variable for receiving the value.
Execute the statement by calling EXEC_SQL.EXECUTE
.
Use EXEC_SQL.FETCH_ROWS
to retrieve
a row in the result set.
Use EXEC_SQL.COLUMN_VALUE
to obtain
the value of each column retrieved by EXEC_SQL.FETCH_ROWS
.
Repeat Steps 3 and 4 until EXEC_SQL.FETCH_ROWS
returns 0.
About the EXEC_SQL
built-in package
EXEC_SQL
built-in package
examples
Changing the primary database connection
Copying data between two databases
EXEC_SQL
predefined exceptions
Copyright © 1984, 2005, Oracle. All rights reserved.