Thursday, February 16, 2023

SQL Code to add SysAdmin responsibility to a specific User


The following query grants a user the System Administrator (SYSADMIN) responsibility. The query must be executed by APPS user.

I used the username "DAVID" in the example below.


-------------------------------------------------------------------------------
-- Query to add SYSADMIN responsibility to a user, using FND_USER_PKG.ADDRESP
-------------------------------------------------------------------------------
BEGIN
    fnd_user_pkg.Addresp(username => 'DAVID', -- User Name -- 
    resp_app => 'SYSADMIN', -- Apps Short Name
    resp_key => 'SYSTEM_ADMINISTRATOR', -- Responsibility Key
    security_group => 'STANDARD', description => NULL, 
    start_date => SYSDATE,
    end_date => NULL);

    COMMIT;

    dbms_output.Put_line('SYSADMIN Responsibility successfully added');
EXCEPTION
    WHEN OTHERS THEN
      dbms_output.Put_line('SYSADMIN responsibility not added due to '
                           || SQLERRM);

      ROLLBACK;
END; 

No comments:

Post a Comment

SQL Code to add SysAdmin responsibility to a specific User The following query grants a user the System Administrator (SYSADMIN) responsibil...