Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Dynamic cursor in PL/SQL
Hi gurus,
I have to do a stored proc to compare the data of two tables in different schemas. I want to use a dynamic cursor and select the content of a table passed in argument.
I saw in a document that I can work with REF CURSOR like this instance:
schema_table := 'DIFF';
open schema_comp for
'select * from TABLE where table_name = :s' using schema_table;
It works with the WHERE clause, but I want to use the FROM clause. I tried the following, but it was unsuccessful:
schema_table := 'TABLE_DIFF';
open schema_comp for
'select * from :s' using schema_table;
Has anyone ever tried this?
TIA
![]() |
![]() |