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: giving field name as variable of a function

Re: giving field name as variable of a function

From: David Pattinson <david_at_addease.com.au>
Date: Thu, 03 Jun 1999 16:50:20 +1000
Message-ID: <375625AC.311CECE7@addease.com.au>

Unfortunately the DBMS_SQL package is not considered 'pure' as of PL/SQL 2.3 (Oracle8 PL/SQL Programming pp300-303). This means AFAIK that any function which uses DBMS_SQL cannot be pure either, even if you declare it in a package and attempt to PRAGMA RESTRICT_REFERENCES(...). Such a function will not be able to be called within an SQL statement, ie you wouldn't be able to say: select a, myfunction(), b from...

David.

Tony Colston wrote:

> I think that you can do this kind of thing with the DBMS_SQL package. It
> lets you create SQL on the fly and execute it.
>
> Tony
>
> Diablo <diabl_at_email.com> wrote in message
> news:7j2r5j$hqt$1_at_usenet48.supernews.com...
> > I need to write a function that takes a field name as variable like this:
> >
> > Function F_PUR_F05
> > ( FieldName IN VARCHAR2)
> >
> > cursor C_PER is
> > SELECT * FROM sometable
> > WHERE FieldName ='XXXX';
> > .......
> >
> > But I could not do it as it does not recognize varchar2 as a fieldname..
> > Any ideas?
> >
> > Any help would be appreciated.
> >
> >
> >
> >
Received on Thu Jun 03 1999 - 01:50:20 CDT

Original text of this message

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