タイプ のレコードを返す関数がありmy_table%ROWTYPE
、呼び出し元で、返されたレコードが null かどうかを確認できますが、PL/SQL は if ステートメントに不平を言います
PLS-00306: 'IS NOT NULL'のコールの引数の数またはタイプが正しくありません
これが私のコードです:
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;
ありがとう。