Parameterized cursors in PL/SQL

From: Ron Reidy <rreidy>
Date: 1995/11/15
Message-ID: <48d26f$sm8_at_peacock.tcinc.com>#1/1


Rene.Hoekstra_at_rivm.nl (Rene Hoekstra) wrote:
>Hi all,
>
>Can I pass a table name as a parameter to a cursor in
>PL/SQL as in :
>
> declare
> cursor c_1 (tname IN VARCHAR2) is
> select <col1>, <col2> ... <coln>
> from tname
> where <where_clause>;
> ...
> begin
> ...
> open c_1 (<tablename>)
> ...
> end;
>
>I've tried the above statement, but it doesn't work. Anyone
>have a solution to this ?
>
>Thanx for any help,
>Rene.
>
>============================================================
>| Rene Hoekstra
>| E-Mail : Rene.Hoekstra_at_rivm.nl
>| National Institute of Public Health and Environmental
>| Protection (R.I.V.M.)
>| Bilthoven, The Netherlands
>============================================================
> " Alleen slaapwandelaars kunnen in slaap vallen "
>============================================================

Rene,

Trye using the package that will allow you to do dynamic PL/SQL (it is documented in the book somewhere). It is similar to Method 3 of Pro*C.

rr

ronreidy_at_ix.netcom.com Received on Wed Nov 15 1995 - 00:00:00 CET

Original text of this message