dbTalk Databases Forums  

SQL alteration

comp.databases.oracle.server comp.databases.oracle.server


Discuss SQL alteration in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
UXDBA
 
Posts: n/a

Default SQL alteration - 07-02-2010 , 10:44 AM






All,
Just one questions. ( I know Oracle is not written this way... but
wanted to see the thread users response/comments )

Session #1 from client 1 :
--------------------------------------

issues the following:

select * from T;

Is there any way this SQL can be intercepted in backend and a filter
is added to this query.
something like....

where 1=2

i.e. Actual sql processed would be

select * from T where 1=2;

So that no rows are retruned to the user who has issued the above sql.
(mainly wanted to add a predicate which is FALSE hence no results set
is returned.)

Thanks

Reply With Quote
  #2  
Old   
Michel Cadot
 
Posts: n/a

Default Re: SQL alteration - 07-02-2010 , 12:20 PM






"UXDBA" <unixdba73 (AT) googlemail (DOT) com> a écrit dans le message de news:
5edf20cb-dc15-48f0-b44c-92f95fb7012a...oglegroups.com...
Quote:
All,
Just one questions. ( I know Oracle is not written this way... but
wanted to see the thread users response/comments )

Session #1 from client 1 :
--------------------------------------

issues the following:

select * from T;

Is there any way this SQL can be intercepted in backend and a filter
is added to this query.
something like....

where 1=2

i.e. Actual sql processed would be

select * from T where 1=2;

So that no rows are retruned to the user who has issued the above sql.
(mainly wanted to add a predicate which is FALSE hence no results set
is returned.)

Thanks

Have a look at VPD and DBMS_RLS package.

Regards
Michel

Reply With Quote
  #3  
Old   
ddf
 
Posts: n/a

Default Re: SQL alteration - 07-02-2010 , 12:21 PM



On Jul 2, 10:44*am, UXDBA <unixdb... (AT) googlemail (DOT) com> wrote:
Quote:
All,
Just one questions. ( I know Oracle is not written this way... but
wanted to see the thread users response/comments *)

Session #1 *from client 1 *:
--------------------------------------

issues the following:

select * from T;

Is there any way this SQL can be intercepted *in backend and a filter
is added *to this query.
something like....

where 1=2

i.e. Actual sql processed would be

select * from T where 1=2;

So that no rows are retruned to the user who has issued the above sql.
(mainly wanted *to add a predicate which is FALSE hence no results set
is returned.)

Thanks
Is there a particular user you're wanting to restrict with this?



David Fitzjarrell

Reply With Quote
  #4  
Old   
UXDBA
 
Posts: n/a

Default Re: SQL alteration - 07-02-2010 , 12:52 PM



On Jul 2, 5:21*pm, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
On Jul 2, 10:44*am, UXDBA <unixdb... (AT) googlemail (DOT) com> wrote:





All,
Just one questions. ( I know Oracle is not written this way... but
wanted to see the thread users response/comments *)

Session #1 *from client 1 *:
--------------------------------------

issues the following:

select * from T;

Is there any way this SQL can be intercepted *in backend and a filter
is added *to this query.
something like....

where 1=2

i.e. Actual sql processed would be

select * from T where 1=2;

So that no rows are retruned to the user who has issued the above sql.
(mainly wanted *to add a predicate which is FALSE hence no results set
is returned.)

Thanks

Is there a particular user you're wanting to restrict with this?

David Fitzjarrell- Hide quoted text -

- Show quoted text -
no . single user issues multiple requests and if the quoted SQL is
issued. we wanted to restrict that SQL alone.

Reply With Quote
  #5  
Old   
ddf
 
Posts: n/a

Default Re: SQL alteration - 07-03-2010 , 12:16 AM



On Jul 2, 12:52*pm, UXDBA <unixdb... (AT) googlemail (DOT) com> wrote:
Quote:
On Jul 2, 5:21*pm, ddf <orat... (AT) msn (DOT) com> wrote:





On Jul 2, 10:44*am, UXDBA <unixdb... (AT) googlemail (DOT) com> wrote:

All,
Just one questions. ( I know Oracle is not written this way... but
wanted to see the thread users response/comments *)

Session #1 *from client 1 *:
--------------------------------------

issues the following:

select * from T;

Is there any way this SQL can be intercepted *in backend and a filter
is added *to this query.
something like....

where 1=2

i.e. Actual sql processed would be

select * from T where 1=2;

So that no rows are retruned to the user who has issued the above sql..
(mainly wanted *to add a predicate which is FALSE hence no results set
is returned.)

Thanks

Is there a particular user you're wanting to restrict with this?

David Fitzjarrell- Hide quoted text -

- Show quoted text -

no . single user issues multiple requests and if the quoted SQL is
issued. we wanted to restrict that SQL alone.- Hide quoted text -

- Show quoted text -
If you don't want anyone to 'see' any data from T why don't you create
a view on T:

create or replace view owner.t_vw as
select * From owner.t where 1=2;

then create a public synonym T for the view you just created:

create public synonym t for owner.t_vw;

At that point only the table owner can see data in table T.


David Fitzjarrell

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.