Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Newbie : Row constraint?
I have a table with different locations. Some users can only update/delete/insert rows for their location. Some users can update rows for any location.
So I have created a table called userlocation with the userid and locationcode:
userid locationcode allowupdate allowinsert allowdelete1
------ ------------- ------------ ----------- ----------
-
user1 location1 1 1 1 user1 location2 1 1 1 user2 location1 0 0 0 user2 location2 1 1
Then before performing an update, I check to see if the user can update
records for that location:
select count(*) as mycount from userlocation where userid=xxx and
locationcode=yyy and allowupdate <> 0
But I wondered if it was possible to achieve the same with a row constraint?
This location table also serves as a 'parent table. So there would be other 'child' tables that would need to link to the userlocation table to check if the record could be updated.
Thanks in advance
Russ Received on Wed Sep 06 2000 - 09:30:01 CDT
![]() |
![]() |