1. 程式人生 > >Oracle Apps修改使用者密碼的API

Oracle Apps修改使用者密碼的API

-- Change password of TEST_USER to oracle123 (does not ask for reset on first logon)
BEGIN
   fnd_user_pkg.updateuser (x_user_name                   => 'TEST_USER',
x_owner => 'CUST',
x_unencrypted_password => 'oracle123',
                            x_end_date                    => fnd_user_pkg.null_date,
x_password_date => SYSDATE - 10,
                            x_password_accesses_left      => 10000,
                            x_password_lifespan_accesses  => 10000,
                            x_password_lifespan_days      => 10000
                           );
   COMMIT;
END;

UpdateUser API Specification
-- UpdateUser (Public)
--   Update any column for a particular user record. If that user does
--   not exist, exception raised with error message.
--   You can use this procedure to update a user's password for example.
--
--   *** NOTE: This version accepts the old customer_id/employee_id
--   keys foreign keys to the "person".  Use UpdateUserParty to update
--   a user with the new person_party_id key.
--
-- Usage Example in pl/sql
--   begin fnd_user_pkg.updateuser('SCOTT', 'SEED', 'DRAGON'); end;
--
-- Mandatory Input Arguments
--   x_user_name: An existing user name
--   x_owner:     'SEED' or 'CUST'(customer)
--
procedure UpdateUser (
  x_user_name                  in varchar2,
  x_owner                      in varchar2,
  x_unencrypted_password       in varchar2 default null,
  x_session_number             in number default null,
  x_start_date                 in date default null,
  x_end_date                   in date default null,
  x_last_logon_date            in date default null,
  x_description                in varchar2 default null,
  x_password_date              in date default null,
  x_password_accesses_left     in number default null,
  x_password_lifespan_accesses in number default null,
  x_password_lifespan_days     in number default null,
  x_employee_id                in number default null,
  x_email_address              in varchar2 default null,
  x_fax                        in varchar2 default null,
  x_customer_id                in number default null,
  x_supplier_id                in number default null,
  x_old_password               in varchar2 default null)
is
begin
  UpdateUserInternal(
    x_user_name => x_user_name,
    x_owner => x_owner,
    x_unencrypted_password => x_unencrypted_password,
    x_session_number => x_session_number,
    x_start_date => x_start_date,
    x_end_date => x_end_date,
    x_last_logon_date => x_last_logon_date,
    x_description => x_description,
    x_password_date => x_password_date,
    x_password_accesses_left => x_password_accesses_left,
    x_password_lifespan_accesses => x_password_lifespan_accesses,
    x_password_lifespan_days => x_password_lifespan_days,
    x_employee_id => x_employee_id,
    x_email_address => x_email_address,
    x_fax => x_fax,
    x_customer_id => x_customer_id,
    x_supplier_id => x_supplier_id,
    x_person_party_id => null,
    x_old_password => x_old_password,
    x_mode => 'EMPLOYEE');
end UpdateUser;