Oracle Apps Script to create a new User Login Account

Source: Internet
Author: User

Oracle Apps Script to create a new User Login Account:

  1. -- CREATE a new user account
  2. DECLARE
  3. P_user_name VARCHAR2 (200): ='Ptiany';
  4. P_owner VARCHAR2 (200): =NULL;
  5. P_unencrypted_password VARCHAR2 (200): ='Welcome';
  6. P_session_number NUMBER: = USERENV ('Sessionid');
  7. P_start_dateDATE: = SYSDATE;
  8. P_end_dateDATE: =NULL;
  9. P_last_logon_dateDATE: =NULL;
  10. P_description VARCHAR2 (200): ='Pan tiany';
  11. P_password_dateDATE: = SYSDATE;
  12. P_password_accesses_left NUMBER: =NULL;
  13. P_password_lifespan_accesses NUMBER: =NULL;
  14. P_password_lifespan_days NUMBER: =NULL;
  15. P_employee_id NUMBER: =NULL;
  16. P_email_address VARCHAR2 (200): ='Tianpan @ gmail.com';
  17. P_fax VARCHAR2 (200): =NULL;
  18. P_customer_id NUMBER: =NULL;
  19. P_supplier_id NUMBER: =NULL;
  20. V_user_id NUMBER;
  21. BEGIN
  22. --
  23. --
  24. Fnd_user_pkg.createuser
  25. (X_user_name => p_user_name,
  26. X_owner => p_owner,
  27. X_unencrypted_password => p_unencrypted_password,
  28. X_session_number => p_session_number,
  29. X_start_date => p_start_date,
  30. X_end_date => p_end_date,
  31. X_last_logon_date => p_last_logon_date,
  32. X_description => p_description,
  33. X_password_date => p_password_date,
  34. X_password_accesses_left => p_password_accesses_left,
  35. X_password_lifespan_accesses => p_password_lifespan_accesses,
  36. X_password_lifespan_days => p_password_lifespan_days,
  37. X_employee_id => p_employee_id,
  38. X_email_address => p_email_address,
  39. X_fax => p_fax,
  40. X_customer_id => p_customer_id,
  41. X_supplier_id => p_supplier_id
  42. );
  43. --
  44. --
  45. SELECTUser_id
  46. INTOV_user_id
  47. FROMFnd_user
  48. WHEREUser_name = p_user_name;
  49. --
  50. DBMS_OUTPUT.put_line ('User _ id :'| V_user_id );
  51. --
  52. COMMIT;
  53. --
  54. EXCEPTION
  55. WHENOTHERSTHEN
  56. --
  57. DBMS_OUTPUT.put_line ('Error while creating a user :'| SQLERRM );
  58. --
  59. END;
The newly created User has not been assigned any accusations, and appropriate responsibilities need to be assigned under Sys admin.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.