Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Trigger
Okay, I know what the problem is:
I was running in a sql file that used to
contain only create statements. So I was
tokenizing the whole file based on semicolons
and sending each individual Create statement
to the database.
The trigger:
CREATE OR REPLACE TRIGGER TI_MDA_PART
INSTEAD OF INSERT ON V_MDA_PART REFERENCING NEW AS N OLD AS OLD FOR EACH ROW BEGIN INSERT INTO MDA_PART (MATERIAL_CODE,PART_NUMBER) VALUES(:n.MATERIAL_CODE, :n.PART_NUMBER, :n.NAME); END;
So breaking it up by semicolons is going to cause me lots of grief....
Raj
Andy Hassall wrote:
> On Tue, 03 Feb 2004 19:58:53 +0000, Andy Hassall <andy_at_andyh.co.uk> wrote:
>
>
>>On Tue, 3 Feb 2004 16:39:21 GMT, Rajesh Patel <rpatel_at_rajix.com> wrote: >> >> >>>I had a sql file that just had Creates for >>>tables/views. Then I tried to add a trigger. >>> >>>I was using a jdbc connection to send the sql >>>file to the database. That worked great until >>>I added the trigger. I kept getting errors from >>>oracle. >> >>Presumably you have ':new' or ':old' in the trigger. This would get >>interpreted as a bind variable from most interfaces. You may be able to >>suppress this depending on your interface, or maybe not. I don't know whether >>you can in JDBC, haven't worked with it much. >> >>But anyway - post the error message, as it may be something entirely >>different.
![]() |
![]() |