, . , , , , , "1 " 1 "" .
In this case, you can simply update both tables. If the identifier does not exist, nothing will be updated. This can be as fast as first selecting by id from table a, and then updating either a or b. You can also use the pl / sql block to improve performance. (If necessary, he will execute only the second expression)
create or replace procedure update_table(p_id in table_a.id%type)
as
begin
update table_a
set status = 0
where id = p_id;
if sql%rowcount == 0 then
update table_b
set status = 0
where id = p_id;
end if;
end;
source
share