Try: -

schema_table := 'DIFF';
open schema_comp for
        'select * from ' || schema_table;

HTH
David Lord

-----Original Message-----
Sent: 17 August 2001 11:46
To: Multiple recipients of list ORACLE-L


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 
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Lord, David - C&S
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to