Algerain sex camira - Trigger updating another table

by  |  16-Sep-2019 21:23

That also has the beneficial side effect of making the application easier to maintain by making it more obvious what is happening and how it happens.There is a caveat though - if the s_orders table is an audit table or a history table and not really part of the Oracle application per se, then using triggers to capture changes and saving diluting the focus of the application is a good design choice.Trigger names exist in the schema namespace, meaning that all triggers must have unique names within a schema.

No menmbership sex chat site - Trigger updating another table

Example: a trigger waits that a user updates a row in the table clients.

When this happens, the trigger automatically inserts a row in another table.

Tables:purchase orders table P_ORDERS: P_order_number, P_poz_number, S_order_number, S_poz_number, P_delivery_date sales orders table S_ORDERS: S_order_number, S_poz_number, S_delivery_date My question is: Is it possible in Oracle and what would be the solution using the TRIGGER on table P_ORDERS to update S_delivery_date with P_delivery_date in S_ORDERS? Not only is this possible in Oracle, it is also straightforward.

All we need to to capture changes to the order date in the p_orders table and to propagate them to the s_orders table is to create a trigger on p_orders that fires every time a row is updated and compares the old and the new order dates.

When using an interactive tool, a single slash (/) on the last line is necessary to activate the 0) DECLARE sal_diff number; BEGIN sal_diff := :- :old.sal; dbms_output.put('Old salary: ' || :old.sal); dbms_output.put(' New salary: ' || :new.sal); dbms_output.put_line(' Difference ' || sal_diff); END; / keyword if you want the trigger to query or change the same table, because triggers can only do that after the initial changes are applied and the table is back in a consistent state.

Community Discussion