I have a function which would return a record with type my_table%ROWTYPE, and in the caller, I could check if the returned record is null, but PL/SQL complains
my_table%ROWTYPE
As far as I know, it's not possible. Checking the PRIMARY KEY or a NOT NULL column should be sufficient though.
PRIMARY KEY
NOT NULL
You can check for v_record.row_id IS NULL.
v_record.row_id IS NULL
Your function would throw a NO_DATA_FOUND exception though, when no record is found.
NO_DATA_FOUND