Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: User defined function acting as a built-in function
>
> 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.
![]() |
![]() |