Re: column masking in 10g

  • From: Jason Heinrich <jheinrich@xxxxxxxx>
  • To: Bill Ferguson <wbfergus@xxxxxxxxx>
  • Date: Thu, 01 Mar 2007 09:54:27 -0600

Good idea.  The advantage to this approach is that all users are presented
with the same view definition, so you don¹t have to deal with the missing
column in any programs that access it.


On 3/1/07 9:20 AM, Bill Ferguson wrote:

> You could also create a view with the CASE statement, similar to:
>  
> CREATE OR REPLACE FORCE VIEW TEST1 ("COL_A", "COL_B", "COL_C") AS
>   select col_a, col_b,
>    case (user) when 'XYZ' then null
>                  else col_c end col_c
>    from your_table;
> 
>  
> You can handle the "user" part various ways, have a table of restricted users,
> etc. to select from, just manually add their names to the list, etc. Or, you
> may have other things to check for as well.
>  
> If the condition is met, col_c returns a null, if the condition is not met,
> then col_c returns the value for that column. I've tested this on 10gR2, I
> don't know how other versions will work.
> 
> -- Bill Ferguson 
> 

---------------
Jason Heinrich
Oracle Database Administrator
Pensacola Christian College
(850) 478-8496 x2509
jheinrich@xxxxxxxx

Other related posts: