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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Passing an arg. to a cursor

Re: Passing an arg. to a cursor

From: <michael_bialik_at_my-deja.com>
Date: Wed, 01 Dec 1999 20:26:41 GMT
Message-ID: <82409r$t5m$1@nnrp1.deja.com>


Hi.

 You have to use dynamic SQL.
 If you are working with 8i - use "native dynamic sql"  otherwise - use DBMS_SQL package.
 See doc : Application Developer Guide.

 HTH. Michael.

In article <384440E3.C74F566A_at_fhcrc.org>,   Douglas Nichols <dnichols_at_fhcrc.org> wrote:
> I want to pass the name of a field in a table to a cursor then do a
> select and other things to that column.
>
> something like:
> I have a table MYTABLE with fields (A number, B NUMBER, C NUMBER);
>
> procedure hello(myvar IN VARCHAR2)
> IS
> CURSOR getme IS (select myvar from MYTABLE);
> BEGIN
> do something here...
> END;
>
> hello('C');
> hello('A');
> ...
>
> Thanks for your input.
> --
> Cheers, dn
>
> Douglas Nichols dnichols_at_fhcrc.org
> ---------------------------------------------------------------
> National Wilms Tumor Study Group 206.667.4283
> Seattle, WA
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Dec 01 1999 - 14:26:41 CST

Original text of this message

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