Create/Drop Oracle Stored Package

Source: Internet
Author: User

Syntax of the Create Package

  1. CREATE OR REPLACEPACKAGE [body] packagenameIS
  2. END;

Sample:

  1. CREATE OR REPLACEPACKAGE overloadedIS
  2. PROCEDUREInsby (namein VARCHAR2 );
  3. PROCEDUREInsby (numbin PLS_INTEGER );
  4. ENDOverloaded;
  5. /
  6. CREATE OR REPLACEPackage body overloadedIS
  7. -- ===================================================== ===
  8. PROCEDURE Local(Namein VARCHAR2, nameoutOUTVARCHAR2)IS
  9. BEGIN
  10. Nameout: = TRANSLATE (namein,'Aeiouaeiou','Eiouaeioua');
  11. END Local;
  12. -- ===================================================== ===
  13. PROCEDUREInsby (namein VARCHAR2)IS
  14. X PLS_INTEGER;
  15. BEGIN
  16. SELECT MAX(Seqno) + 1
  17. INTOX
  18. FROMPersons;
  19. INSERT INTOPersons
  20. (Seqno,Name)
  21. VALUES
  22. (X, namein );
  23. COMMIT;
  24. ENDInsby;
  25. -- ===================================================== ===
  26. PROCEDUREInsby (numbin PLS_INTEGER)IS
  27. X VARCHAR2 (30 );
  28. BEGIN
  29. SELECT MAX(Name)
  30. INTOX
  31. FROMPersons;
  32. Local(X, x );
  33. INSERT INTOPersons
  34. (Seqno,Name)
  35. VALUES
  36. (Numbin, x );
  37. COMMIT;
  38. ENDInsby;
  39. -- ===================================================== ===
  40. ENDOverloaded;
  41. /
  42. ExecOverloaded. insby ('Helen Lofstrom');
  43. ExecOverloaded. insby (4 );

Syntax of the Drop Package

DROPPACKAGE [BODY] [Schema.] Package_name;

Sample:

  1. DROPPackage inv. INV_TRANSFER_ORDER_PVT;
  2. DROPPackage body inv. INV_TRANSFER_ORDER_PVT;

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.