Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: need help for trigger
Venkat,
Venkat Mundrathi wrote:
> I am new to oracle(triggers). I am using personal oracle 8.0,
>
> 1)The purpose of trigger is when ever I insert a new row in the emp
> table(hope you know the description) with the same empno or ename it has to
> fire and give an error message to user that the row with empno or ename is
> already exist.
I do believe in triggers but this application is not appropriate.Why not use an unique key for this purpose ?
> 2) I created a new table U_OBJECTS( name varchar(40),type
> varchar(15),created date). I inserted the values from user_objects table.
> Now i tried to create a trigger, it should fire such that when ever a new
> row is inserted in user_objects the table U_OBJECTS has to be updated( does
> this sounds ridiculous). when i was compiling thetrigger it is give me the
> following error
Your problem here is trying to implement a trigger on a SYS object that is a view, not a table. I you really want to do this (and i would not recommend it), you should create your trigger on the underlying table(s) of the VIEW in the SYS schema.
>
>
> ORA 25001- CANNOT CREATE THIS TRIGGER TYPE ON VIEWS
>
> can you please comment on this.
>
> thanks in advance
Regards,
Marc Mazerolle
InforMaze Technologies
Received on Mon Feb 22 1999 - 12:03:31 CST