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

Home -> Community -> Usenet -> c.d.o.server -> Re: Calling user defined function in SQL where clause

Re: Calling user defined function in SQL where clause

From: DA Morgan <damorgan_at_exxesolutions.com>
Date: Mon, 07 Apr 2003 08:59:45 -0700
Message-ID: <3E91A071.2F23DF2@exxesolutions.com>


r2i wrote:

> I require to call a function (for encryption..etc) inside a where
> clause of my sql.
>
> Example:
> select * from table
> Where col = my_func();
>
> The col is defined as a Varchar and this works fine as long as
> my_func() returns a string value.
>
> However, i need to change the sql to handle multiple values in the
> where clause, therefore i changed the sql to
> select * from table
> Where col in (my_func());
>
> now my_func() returns a string which has multiple strings separated by
> commas.
>
> This also works, as long as myfunc() returns 1 value. The moment i
> modify myfunc() to return multiple strings separated by commas, the
> sql fails to return any results. I tweaked myfunc() to return multiple
> values, with quotes, without quotes, embedded in double quotes..etc
> but to no affect.
>
> Is there any way, i can get this to work, or find a solution to this
> problem in another way?

You need to convert this to native dynamic SQL.

Daniel Morgan Received on Mon Apr 07 2003 - 10:59:45 CDT

Original text of this message

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