> Hi,
> 
> I want to know if i a user can access only a part of a table of another user.
> Ex.: table teste ( name1 varchar2(10) , name2 varchar2(10))
> Can i create a user that can access where name2 = 'ORACLE'???
> or 
> Can i create a user that can access only the lines that its insert????
> If not, i need a solution about it???
> 
> Thanks
> 
> Fabio Bispo
> fabio@trt20.gov.br
> 
Fabio,

One way to do this is to make views with the appropriate restrictions.
Then, you can grant SELECT on the view to the user. So, in your case, the
view would be defined as:

CREATE VIEW limited_to_oracle AS
SELECT * FROM teste
WHERE NAME2 = 'ORACLE';

As for creating a view so that users can only see the records that they
added, you can add a column in the table with the USERNAME of who did the
insert. You can add a BEFORE INSERT trigger to populate this column with
the username. Then the view would limit the result set to only records
that are the same as the current username.

Best regards,

-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 280+ Oracle tips, visit my Web Page:                      <->
<->                                                               <->
<->             www.arikaplan.com                                 <->
<->                                                               <->
<->             email: akaplan@interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

Back to Ari Kaplan's Home Page Back to Ari Kaplan's Home Page