Verifique um registro NÃO É NULL no plsql
Tenho uma função que retornaria um registro com o tipomy_table%ROWTYPE
e no chamador, pude verificar se o registro retornado é nulo, mas o PL / SQL reclama a instrução if de que
PLS-00306: número ou tipos de argumentos incorretos na chamada para 'IS NOT NULL'
Aqui está o meu código:
v_record my_table%ROWTYPE;
v_row_id my_table.row_id%TYPE := 123456;
begin
v_record := myfunction(v_row_id)
if (v_record is not null) then
-- do something
end if;
end;
function myfunction(p_row_id in my_table.row_id%TYPE) return my_table%ROWTYPE is
v_record_out my_table%ROWTYPE := null;
begin
select * into v_record_out from my_table
where row_id = p_row_id;
return v_record_out;
end myfunction;
Obrigado