Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with a trigger

Re: Help with a trigger

From: Karl E. Jørgensen <kjorg_at_msn.com>
Date: 1998/01/08
Message-ID: <#vOmNeHH9GA.169@upnetnews04>#1/1

>> The first error is ok (ORA-20001), but why appears the errors ORA-06512
>> and ORA-04088 ??.

Don't be overly worried about those. Actually, they are VERY NICE to have at times as they help you pinpoint where the error was raised FROM.

Do the extra lines cause you any problems ? Remember that only the first line will show up in the PL/SQL "sqlerrm" function.

--
Karl
Oracle Certified DBA
Francesc Vargas wrote in message <34b50398.0_at_news.navigato.com>...

>I have made a trigger like this...
>
>---------------------------------------------------------------------------
-
>create or replace trigger control_odd_trig
>before insert or update on control_taules_odd
>for each row
>
>declare
> nom_de_taula varchar(30);
> vegades number;
>begin
> SELECT table_name INTO nom_de_taula FROM all_tables
> WHERE owner = 'DBAPROV' and
> table_name = upper(:new.nom_taula);
>
> if :new.cal_crear_sn = 'S' then
> SELECT count(*) INTO vegades FROM control_taules_odd
> WHERE entidad = :new.entidad and
> nom_taula = upper(:new.nom_taula) and
> cal_crear_sn = 'S';
>
> if vegades >= 1 then
> raise_application_error
> (-20002, 'Una taula sols es pot crear en un
>model');
> end if;
> end if;
>
>exception
> when no_data_found then
> raise_application_error
> (-20001, 'Taula ('||:new.nom_taula||') Inexistent');
>end;
>/
>---------------------------------------------------------------------------
-
>
>
>When the insert is ok, execution of the trigger works fine
>
>---------------------------------------------------------------------------
-
>SQL> insert into control_taules_odd values(2074,'FUNCIONES','N','XX');
>
>1 row created.
>---------------------------------------------------------------------------
-
>
>
>but when the trigger make a 'raise_application_error' in the SqlPlus
>appears:
>
>---------------------------------------------------------------------------
-
>SQL> r
> 1* insert into control_taules_odd values(2074,'YYYY','N','XX')
>insert into control_taules_odd values(2074,'YYYY','N','XX')
>*
>ERROR at line 1:
>ORA-20001: Taula (YYYY) Inexistent
>ORA-06512: at "DBAPROV.CONTROL_ODD_TRIG", line 20
>ORA-04088: error during execution of trigger 'DBAPROV.CONTROL_ODD_TRIG'
>---------------------------------------------------------------------------
-
>
>
>The first error is ok (ORA-20001), but why appears the errors ORA-06512
>and ORA-04088 ??.
>
>I works in ORACLE 7.3.3.4 on AIX machine.
>
>TIA,
>
>
>
begin 666 Karl E. Jørgensen.vcf M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DKX<F=E;G-E;CM+87)L.T4N M#0I&3CI+87)L($4N($KX<F=E;G-E;@T*3D]413I396YI;W(@4WES=&5M<R!% M;F=I;F5E<@T*55),.@T*55),.FAT=' Z+R]S97%U96PM:6UA9V4N8V]M#0I% M34%)3#M04D5&.TE.5$523D54.E-004U'54%21"!K:F]R9T!M<VXN8V]M#0I2 @158Z,3DY.# Q,#A4,C U,S(P6_at_T*14Y$.E9#05)$#0H` ` end end
Received on Thu Jan 08 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US