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 sql help needed

Dynamic sql help needed

From: Cale, Rick T (Richard) <RICHARD.T.CALE_at_saic.com>
Date: Tue, 29 Aug 2000 09:19:05 -0700
Message-Id: <10603.115746@fatcity.com>


Hi All,

In my PL SQL script I have 2 cursors. The first one gets a table_name and the 2nd one get 2
fields(field1 and field2). What I would like to do is build dynamic sql using these variables. What I need
is to build a 3rd cursor using the table_name,field1 and field2 from the first 2 cursors.

For example SELECT COUNT(*)

                    FROM table_name
                    WHERE col1 = field1
                    AND       col2 = field2;

I cannot seem to find an example where the table_name is dynamic.

Thanks Received on Tue Aug 29 2000 - 11:19:05 CDT

Original text of this message

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