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

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

RE: Dynamic cursor in PL/SQL

From: Lord, David - C&S <David.Lord_at_hayscsg.com>
Date: Fri, 17 Aug 2001 03:12:27 -0700
Message-ID: <F001.0036E8CF.20010817031529@fatcity.com>

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: David.Lord_at_hayscsg.com

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: ListGuru_at_fatcity.com (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).
Received on Fri Aug 17 2001 - 05:12:27 CDT

Original text of this message

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