How to hide the Columns in the View?

  • Hai,

    I have a view with 10 columns.

    I want to hide, some columns when we put

    select * from viewname.

    Because, I need that for different login user ids. Depends on the user id

    i can hide some columns.

     

     

     

     

     

     

  • Hi Amie,

    You can restrict the columns available to the user by granting select permissions only on the column of the view to the user.

    E.g.

     

    Grant select on xyzview(empid,empname) to abcuser

     

    Hope this helps ...

     


    Kindest Regards,

    Sureshkumar Ramakrishnan

  • If u do this, u would just get an permissions error if u tried to do a "SELECT *" !!

    You'll need to specify the fields you want when doing the select ... there isn't really any way to "hide" the columns! Being exact with ur queries is always a good habit to get into anyway!

  • It's not only a good habit... it's one of the very first best pratice anyone should learn. Comes bite you in the ass so often that you have no choice but to learn it some day.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply