|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Update Condition
Hi
For the following schema: The itemtot attribute needs to be automatically maintained and not be directly updateable. I have been given very little information regarding this but I would assume that it should not be allowed to be updated at any time in practice. In terms of how many times it could be updated I would probably guess it would have to be a yearly thing. No other information has been received. The only information I was given was that due to the inclusion of itemtot attribute in the database this has provided a very bad design. Not sure if this helps at all. Think that is why I have had so much trouble with this one, as am not sure what angle to take it from or where to start. Any help would be appreciated. Thanks again. |
|
#2
|
|||
|
|||
|
As I understand you want nobody to update a specific column/attribute explicitly. Regarding to your information I made little bit changes in your code, and you can also modify it according to your requirement.
CREATE OR REPLACE TRIGGER check_itemtot AFTER UPDATE OF itemtot ON Item WHEN (new.itemtot<>null) BEGIN RAISE_APPLICATION_ERROR(-20214,'Column itemtot can not be updated explicitly'); END; In above code trigger will check the value of itemtot if any user provide the value at the time of insertion, this trigger will fire and display the error message. Regards, |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Update Condition |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|