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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: User defined function acting as a built-in function

Re: User defined function acting as a built-in function

From: PL. Rukmani <mani_at_TC4HQ.CMC.STPH.NET>
Date: Sun, 31 Dec 1995 17:35:26 -0500
Message-Id: <9512311217.AA07561@alice.jcc.com>


>
> Hi folks,
>
> Is there a way to write an user defined stored function in Oracle
> which can act as a built-in function, that is, can be used in Select clause
> of an SQL statement.
> Any suggestion will be appreciated.
> TIA
>

Hi Bharat,

I guess any stored function in Oracle can be used in places where an expression can be present. Therefore, it should be perfectly valid to use a stored function in a SELECT list also. Anyway, to confirm, I tried the following :

Create a function addn using the script :

create or replace function addn(n1 number) return number as begin

   return n1+1;
end;
/

Doing "select addn(5) from dual" returned me the expected 6.

Is the above not possible in your DB ?

Our configuration is Oracle ver 7.1.3 on SVR5.



PL. Rukmani,
CMC Ltd.
E-Mail : mani_at_tc4hq.cmc.stph.net Received on Sun Dec 31 1995 - 07:17:26 CST

Original text of this message

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