I would like to validate removing record from table checking its primary key for integrity constraint violation.
I've created a function returning boolean with the following code:
DECLARE n NUMBER; BEGIN SELECT count(*) INTO n FROM table_name WHERE smth_id = :ID; IF n > 0 THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END;
The request is correct, I confirmed it putting real ID instead of
WHERE smth_id = 105. So it seems to me the problem is in the
:ID expression exactly.
Can you advise, how to get the ID of the selected row in function? My code has condition "When Button Pressed - MULTI_ROW_DELETE" and I have ID column on table page.