Re: SET ROLE

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1997/02/17
Message-ID: <hM9MXHAgHKCzEwhm_at_jimsmith.demon.co.uk>#1/1


In article <01bc1ce6$d78366a0$096fc589_at_RSNOWDEN.labinterlink.com>, Roger Snowden <rsnowden_at_IHateSpam.com> writes
>> Anyone knows how can I Set a Role From a Database Procedure or a
>> Database Function ???
>
>You don't really 'set' a role in Oracle. You can grant a role to a user,
>though. A user can have multipe roles, so role privileges are cumulative.
>
Yes you do. A user can have multiple roles, not all of which are currently active. You can't issue a set role command directly in a procedure, not even with dbms_sql. There is a set_role procedure in (I think) the dbms_session package. So you can do dbms_session.set_role('ne w_role').

>As I said, you may have to do a bit of reading here, but I just did this
>last week and it works fine. You can also create new users and change
>passwords this way. Handy dandy stuff to do with Forms 4.5, eh?

You need to do some more reading. Try looking at the 'alter session set role' command and go from there.

-- 
Jim Smith
Received on Mon Feb 17 1997 - 00:00:00 CET

Original text of this message