Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Newbie : Row constraint?

Newbie : Row constraint?

From: Russell England <russ_at_css2.com>
Date: Wed, 06 Sep 2000 14:30:01 GMT
Message-ID: <Jxst5.6884$yG4.578420@news1.cableinet.net>

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    allowdelete

------ ------------- ------------ ----------- ----------
-
user1 location1 1 1 1 user1 location2 1 1 1 user2 location1 0 0 0 user2 location2 1 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US