Re: Conditional Views
From: <hatzinger_m_at_bmwf1f.bmwf.gv.at>
Date: 20 Oct 92 07:47:44 GMT
Message-ID: <1992Oct20.075937.50_at_bmwf1f.bmwf.gv.at>
Date: 20 Oct 92 07:47:44 GMT
Message-ID: <1992Oct20.075937.50_at_bmwf1f.bmwf.gv.at>
In article <1992Oct19.162139.967_at_ee.gatech.edu>, flur_at_eecom.gatech.edu (Peter W. Flur) writes:
> Can someone suggest a good way to make conditional views? What
> I mean is to have a view that allows an oracle user to only
> access the rows of a table that they somehow "own" (maybe by
> a "username" field or something).
>
> I'd like to create a view something like
> create mytable as select * from bigtable where myoracleid=mytable.userid;
CREATE VIEW myview AS
SELECT *
FROM bigtable
WHERE bigtable.userid = user
WITH CHECK OPTION;
This view allows select,insert,update and delete only on rows, where the column
*userid* of bigtable is equal to the system-variable *user*.
KMH ================================================================================ ^ Federal Ministry of Science and Research B | M <-------------------------------------------------------------------------+----> Computer Center W | F | Klaus-Michael Hatzinger mail: hatzinger_m_at_bmwf1f.bmwf.gv.at | Bankgasse 1/209 phone: 0043-222-53120/5188 | 1014 Vienna, Austria fax: 0043-222-53120/5155 V ================================================================================Received on Tue Oct 20 1992 - 08:47:44 CET