
September 8th, 2004, 12:56 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 22
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I have A Trigger....
Hi
I have a constraint for which I need to create a triiger to satify the requirement. The constraint is:
The itemtot attribute needs to be automatically maintained and not be directly updateable.
I have tackled it in this way, shown below:
CREATE OR REPLACE TRIGGER check_itemtot
AFTER UPDATE OF itemtot ON Item
DECLARE
v_itemtot_changes NUMBER;
BEGIN
SELECT upd, max_itemtot
INTO v_itemtot_changes
FROM audit_table
I am sure the above trigger is incorrect and does not satisfy the reuirements for this constraint. I do nt think an audit table is required for this, but was totally unsure of how to create a trigger for this cosntraint.
Can anyone advise on the type of trigger needed for this scenario. Also advice on syantax, coding, layout etc would be helpful for future similar constraints.
Thanks.
|