How can you execute queries using the dbms_sql package? | Oracle DBA

You must perform the following steps if you are using dynamic Structured Query Language(SQL) to process a query:
i. Specify the variables that are to receive the values returned by the SELECT statement by calling the DEFINE_COLUMN,DEFINE_COLUMN_LONG, or DEFINE_ARRAY procedures.
ii. Run the SELECT statement by calling the EXECUTE function.
iii. Call the FETCH_ROWS (or EXECUTE_AND_FETCH)
iv. function to retrieve the rows that satisfied the query.
iv. Call the COLLIMN_VALUE or COLUMN_VALUE_LONG procedure to determine the value of a column retrieved by the FETCH_ROWS function for the query. If you use anonymous blocks containing calls to PL/SQL procedures, then you must call the VARIABLE_VALUE procedure to retrieve the values assigned to the output variables of these procedures.