Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Create a Trigger for an existing View
On Apr 9, 3:43 pm, "Dean Tomasevic" <dean.tomase..._at_googlemail.com>
wrote:
> Hi!
>
> I created a view from the two existing tables (DEMO_USERS and
> DEMO_ORDERS).
>
> Code:
> CREATE VIEW DEMO_MY_TEST AS
> SELECT DEMO_USERS.USER_ID, DEMO_ORDERS.ORDER_ID
> FROM DEMO_USERS
> INNER JOIN DEMO_ORDERS
> ON DEMO_ORDERS.USER_ID = DEMO_USERS.USER_ID
>
> So now my job is to update my view if anybody will take an new order.
> As example:
> If user X with the USER_ID 2 will complete a new order my trigger must
> updating the view.
>
> But i have problems with the trigger, i know that i must write an
> updating trigger, but the actuator for the trigger is an "insert into"
> into the DEMO_ORDERS table, because only if a new order will insert
> into the DEMO_ORDERS table, then the trigger must be activated and
> updating the view.
>
> Thanks a lot.
>
> Dean Tomasevic
If I'm reading your question correctly, you need to google for:
oracle mutating triggers
If I'm reading your question incorrectly, you just need to have the trigger on the demo_orders table, and let us know the exact error, version, trigger code, etc.
jg
-- @home.com is bogus. http://headrush.typepad.com/creating_passionate_users/2006/12/how_to_build_a_.htmlReceived on Mon Apr 09 2007 - 18:30:23 CDT
![]() |
![]() |