Answer the question
In order to leave comments, you need to log in
Why in oracle pl/sql trigger doesn't react on all rows i insert in table?
Hello!
I have a table like this in Oracle PL/SQL:
This is the shot table. I have people who participate in a marksmanship competition. The name column describes the shooter's name, the x column shows the x coordinate of the bullet's point of impact, and the y column shows the y coordinate of the bullet's point of impact. It is assumed that the data will be entered immediately in three lines after each team of 3 shoots. Here is what the query for inserting the results of a shot looks like:
insert all
into shots (name, x, y)
values ('Bill', 12, 61)
into shots (name, x, y)
values ('Marat', 150, 85)
into shots (name, x, y)
values ('Ivan', 18, 13)
select * from dual;
create or replace trigger delet_shot
before INSERT on shots
for each row
begin
if (:new.x > 120) then
raise_application_error(-20000, 'Стрелок не попал в мишень');
end if;
end;
Answer the question
In order to leave comments, you need to log in
The request goes in one transaction - if something gets corrupted in it, the entire transaction is rolled back.
Send in separate transactions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question