Record types and is null function.
243246Apr 22 2005 — edited Apr 27 2005Hello,
consider the following example. Is there a documented reason why I cannot use a record as operand for the "is null" function?
Do you know a work-around?
Thank you.
Have a nice day.
Björn
create or replace function get_Employee(
i_Employee_Id in hr.Employees.Employee_Id%type
)
return hr.Employees%rowtype
is
l_Result hr.Employees%rowtype;
begin
select *
into l_Result
from hr.Employees
where Employee_Id = i_Employee_Id;
return l_Result;
exception
when No_Data_Found then
return null;
end;
/
declare
l_Emp hr.Employees%rowtype := get_Employee(9999);
begin
if (l_Emp is null) then
dbms_output.put_line('Missing.');
end if;
end;
/
ERROR at line 4:
ORA-06550: line 4, column 7:
PLS-00306: wrong number or types of arguments in call to 'IS NULL'
ORA-06550: line 4, column 3:
PL/SQL: Statement ignored