Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> User defined functions in PL/SQL loop
Oracle 7.3.4
Pure user defined function that takes 3 in parameters
Usable from SQL*Plus in simple select.
However in PL/SQL :-
create or replace procedure fix_something(
i_datestamp date, i_numeric number
) is
m_thingy varchar2(10);
cursor c1 (i_date1 date, i_number1 number, i_thingy varchar2) is
select my_function(i_date1, i_number, i_thingy) from my_table where
......;
begin
m_thingy := 'xyz'
for r1 in c1 (i_datestamp, i_numeric, m_thingy) loop
....
end loop;
end;
.
Error ORA-904 (number may be wrong, I'm not on-site) Value Error.
With SQL trace on, I can see that the cursor is actually sent to the database engine for parsing as
select my_function(,,) from my_table where .... ;
In other words the input parameters simply cease to exist.
Have I missed something obvious about restriction in PL/SQL and user-defined functions in the manuals or is this an error ?
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Received on Fri Feb 12 1999 - 16:01:26 CST