Flavio Casetta

Subscribe to Flavio Casetta feed
Welcome to Flavio Casetta's official Oracle database application development related blog. No Mysql supporters were hurt in the making of this blog.
Updated: 17 hours 34 min ago

DBA_ERRORS and error lines reported for TRIGGERS

Wed, 2024-07-24 09:46

As you probably know, the lines shown in views DBA_ERRORS/ALL_ERRORS/USER_ERRORS in the case of triggers are wrong.

But they are not totally wrong, they are just shifted by the amount of lines between the line containing the keyword TRIGGER and either DECLARE or BEGIN, whichever occurs first.

See the example below for an error reported by the dba_errors view on line 2 caused by missing grants on the table used in the variable declaration:

TRIGGER GAGREA2.TR_ASSEGNAZIONE_AI
AFTER INSERT ON ASSEGNAZIONE
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
LI_ID_ASSEGNAZIONE_DOM_RICGEN GAGREA2.DOMANDA_ASG_SPECIFICHE.ID_ASSEGNAZIONE_DOM_RICGEN%TYPE;
BEGIN

GAGREA2.PKG_TRIGGER.SET_ID_ASSEGNAZIONE_DOM_RICGEN ( :NEW.ID_DOMANDA, LI_ID_ASSEGNAZIONE_DOM_RICGEN );

END TR_ASSEGNAZIONE_AI;

So, the real line number can be obtained adding the number of the line containing DECLARE (or BEGIN if DECLARE is missing) minus 1, that is 2 + 5 - 1 = 6.


Categories: DBA Blogs

When #OWNER# is not the OWNER you expected

Tue, 2024-03-05 08:24
Categories: DBA Blogs

APEX feature request, support needed!

Tue, 2024-02-20 01:10
Categories: DBA Blogs

Fixing the SRID in a spatial geometry column

Tue, 2023-05-30 07:02
Categories: DBA Blogs

The strange case of ORA-01841 and ADD_MONTHS

Mon, 2023-03-06 06:29
Categories: DBA Blogs

The strange case of the REVERSE function

Wed, 2022-10-26 04:30
Categories: DBA Blogs

Pages