Home » RDBMS Server » Server Utilities » PLS-00103: Encountered the symbol ";" when expecting one of the following:
PLS-00103: Encountered the symbol ";" when expecting one of the following: [message #188288] Thu, 17 August 2006 17:21 Go to next message
superoscarin@hotmail.com
Messages: 101
Registered: July 2006
Location: Mexico
Senior Member

I have a little problem with my trigger...Can you please help me??...

Here my trigger...

CREATE OR REPLACE TRIGGER dm08_inserta_catalogos
AFTER insert ON dm08_base_origen FOR EACH ROW
DECLARE
v_id_base_origen NUMBER;
BEGIN

select ID_BASE_ORIGEN INTO v_id_base_origen from (select Rownum Row#, ID_BASE_ORIGEN from DM08_BASE_ORIGEN WHERE ID_BASE_ORIGEN <> 1 ORDER BY 1 DESC)where ROWNUM<2;

IF v_id_base_origen <> 0 THEN
insert into DM08_RETENEDOR values(v_id_base_origen||99999,v_id_base_origen,'NO DEFINIDO');
insert into DM08_PARENTESCO values(v_id_base_origen||99,v_id_base_origen,'NO DEFINIDO');
insert into DM08_NIVEL_GOBIERNO values(v_id_base_origen||999,v_id_base_origen,'NO DEFINIDO');
insert into DM08_TIPO_PODER values(v_id_base_origen||999,v_id_base_origen,'NO DEFINIDO');
insert into DM08_UNIDAD_PAGO values('v_id_base_origen||99999',v_id_base_origen||99999,'NO DEFINIDO');
insert into DM08_TIPO_LOCALIZADOR values(v_id_base_origen||99,v_id_base_origen,'NO DEFINIDO');
insert into DM08_TIPO_ASEN values(v_id_base_origen||99,v_id_base_origen,'NO DEFINIDO');
insert into DM08_TIPO_PLAN values('v_id_base_origen||99999',v_id_base_origen,'NO DEFINIDO');
insert into DM08_ESTADO values(v_id_base_origen||99,v_id_base_origen,'NO DEFINIDO','ND');
insert into DM08_CIUDAD values(v_id_base_origen||99,99,'NO DEFINIDO');
insert into DM08_DELMUN values(v_id_base_origen||99,999,'NO DEFINIDO');
insert into DM08_COLONIA values(v_id_base_origen||99,99,999,v_id_base_origen||999,99999,v_id_base_origen||99,'NO DEFINIDO');
ELSE IF
DBMS_OUTPUT.PUT_LINE (v_id_base_origen|| 'no es un valor permitido' );
END IF;
END dm08_inserta_catalogos;
/

the message error is:

SQL> SHOW ERROR;
Errors for TRIGGER DM08_INSERTA_CATALOGOS:

LINE/COL ERROR
-------- -----------------------------------------------------------------
22/71 PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( * % & = - + < / > at in is mod not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like
between ||

Thanks guys
Alex.

[Updated on: Thu, 17 August 2006 17:22]

Report message to a moderator

Re: PLS-00103: Encountered the symbol ";" when expecting one of the following: [message #188292 is a reply to message #188288] Thu, 17 August 2006 17:57 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
The ELSE IF should actually be ELSIF.
Re: PLS-00103: Encountered the symbol ";" when expecting one of the following: [message #188294 is a reply to message #188292] Thu, 17 August 2006 18:27 Go to previous messageGo to next message
superoscarin@hotmail.com
Messages: 101
Registered: July 2006
Location: Mexico
Senior Member

Thanks again ebrian

But now i'm having the follow error when insert a record in my table DM08_BASE_ORIGEN

ORA-04091: table name is mutating, trigger/function may not see it

My trigger insert the value of my new ID_BASE_ORIGEN plus some concatenated values in other tables.


I&acute;m reading that i need not to modify/query data from DM08_BASE_ORIGEN, the point is how can i use :new??

Does It replace my v_id_base_origen??

Greetings
Alex

[Updated on: Thu, 17 August 2006 18:58]

Report message to a moderator

Re: PLS-00103: Encountered the symbol ";" when expecting one of the following: [message #188304 is a reply to message #188288] Thu, 17 August 2006 19:50 Go to previous messageGo to next message
BlackSwan
Messages: 25047
Registered: January 2009
Location: SoCal
Senior Member
>ORA-04091: table name is mutating, trigger/function may not see it
This is a FAQ.
GOOGLE is your friend but only if you actually use it!
Results 1 - 10 of about 312 for ORA-04091: table name is mutating, trigger/function

Also http://asktom.oracle.com has many, many fine coding examples.

[Updated on: Thu, 17 August 2006 20:08] by Moderator

Report message to a moderator

Re: PLS-00103: Encountered the symbol ";" when expecting one of the following: [message #188308 is a reply to message #188288] Thu, 17 August 2006 20:28 Go to previous message
superoscarin@hotmail.com
Messages: 101
Registered: July 2006
Location: Mexico
Senior Member

thanks anacedent for your time

Greetings
Alex
Previous Topic: SQL LOADER
Next Topic: Loading default value when exists null or blanks SQL Loader
Goto Forum:
  


Current Time: Wed Dec 07 14:34:10 CST 2016

Total time taken to generate the page: 0.12808 seconds