Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Record types and is null function.

243246Apr 22 2005 — edited Apr 27 2005
Hello,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2005
Added on Apr 22 2005
11 comments
7,265 views