Sunday, 7 April 2019

SQL to add System Administrator Responsibility to user from Back-end in Oracle

Below Sql script is used to add System Administrator Responsibility to user from back end in Oracle.

SET SERVEROUTPUT ON SIZE 10000000;

BEGIN
   fnd_user_pkg.addresp ('USER_NAME',
                         'SYSADMIN',
                         'SYSTEM_ADMINISTRATOR',
                         'STANDARD',
                         'Add Responsibility to USER using pl/sql',
                         SYSDATE,
                         SYSDATE + 100);
   COMMIT;
   DBMS_OUTPUT.put_line ('Responsibility Added Successfully');
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line(   ' Responsibility is not added due to '
                           || SQLCODE
                           || SUBSTR (SQLERRM, 1, 100));
      ROLLBACK;
END;

No comments:

Post a Comment