Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Call stored Function from SQL statement?
In the case of your function here Yes you can call it from SQL.
select sum_nums(1,5,7)
from dual;
or
select sum_nums(item_price1, item_price2, item_price3) from order_item_table;
the second example will return on answer for each row in the table.
There are a set of rules for a function to be included in a SQL statement. Basically it boils down to the function must be a single row function (not Group), it cannot do any DML and cannot call any procedure or function that breaks rule #1 or #2.
Kenny Gump
OCP 7.3 DBA
//////////////////////////
//////////////////////////