Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Dynamic cursor in PL/SQL

Dynamic cursor in PL/SQL

From: DEMANCHE Luc (Cetelem) <Luc.Demanche_at_cetelem.fr>
Date: Fri, 17 Aug 2001 02:35:18 -0700
Message-ID: <F001.0036E816.20010817024532@fatcity.com>

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



Luc Demanche
CETELEM
Tél.: 01-46-39-14-49
Fax : 01-46-39-59-88 Received on Fri Aug 17 2001 - 04:35:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US