I can explicitly qualify variable in the body of stored procedure or function :
create or replace
PROCEDURE ptest AS
int_val INT;
BEGIN
ptest.int_val:=0;
END;
/
How to do the same inside trigger ?
create table temp1(id int not null);
create or replace trigger trg_before_insert_temp1 before insert on temp1 for each row
declare int_val int;
begin
trg_before_insert_temp1.int_val := 0; -- PLS-00201, identifier must be declared
end trg_before_insert_temp1;
/
int_val := 0;
should be all you need in the trigger.insert into ... returning some_field into int_val
. And in general, I believe specifying everything explicitly makes the code more readable and less error-prone.