Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    102

    Unanswered: Case Statement in where clause

    Dear All,

    I have a table like below

    Table name: abc

    A--------B-------C
    ===============
    mm------0
    nn-------10------Y
    xy-------12

    I want to create view with this table ABC. if user = momin then he can see all the records from ABC table.

    other then momin, other users only can see those value where C is null.


    Pls help me...................
    Working Together...

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool Vpd

    Quote Originally Posted by Momin View Post
    Dear All,

    I have a table like below

    Table name: abc

    A--------B-------C
    ===============
    mm------0
    nn-------10------Y
    xy-------12

    I want to create view with this table ABC. if user = momin then he can see all the records from ABC table.

    other then momin, other users only can see those value where C is null.


    Pls help me...................
    Lookup Virtual Private Database (Fine-Grained Access Control) in the fine Oracle® Database Security Guide
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Code:
    Select * 
    from abc
    where (user = 'MOMIN' 
    or (user <> 'MOMIN' and c is null));
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2004
    Posts
    102
    Quote Originally Posted by beilstwh View Post
    Code:
    Select * 
    from abc
    where (user = 'MOMIN' 
    or (user <> 'MOMIN' and c is null));

    it works..........thanks.

    Is there any other process for do this.
    Working Together...

  5. #5
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by Momin View Post
    Is there any other process for do this.
    See the post from LKBrwn_DBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •