Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: PACKAGES: overloading Jump to:  
Category: >> Oracle PL/SQL >> PACKAGES: overloading Bookmark and Share

<< lastnext >>

Snippet Name: PACKAGES: overloading

Description: Packages can contain multiple iterations of procedures with the same name using different parameters. This is called 'overloading'.

Also see:
» PACKAGES: initialization
» PACKAGES: related queries
» PACKAGES: alter package
» PACKAGES: one function
» PACKAGES: one procedure
» UTL_FILE file write to file example
» Create Package
» UTL_FILE import data

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 10th, 2009

Identify An Overloaded PACKAGE
 
SELECT overload, position, argument_name, in_out, data_type
FROM all_arguments
ORDER BY overload, position;
 
 
CREATE OR REPLACE PACKAGE overload_pkgIS 
  PROCEDURE insby(namein VARCHAR2);
  PROCEDURE insby(numbin PLS_INTEGER); 
END overload_pkg;
/
 
========================================
 
 
CREATE OR REPLACE PACKAGE BODY overload_pkg IS
PROCEDURE local_proc(namein VARCHAR2, nameout OUT VARCHAR2) IS
BEGIN
  nameout := TRANSLATE(namein,'AEIOUaeiou','EIOUAeioua'); 
END local_proc;
--==========================================
PROCEDURE test_proc (namein  VARCHAR2) IS
 y PLS_INTEGER; 
BEGIN
  SELECT MAX(seqno)+1
  INTO y
  FROM persons;
 
  INSERT INTO persons
  (seqno, name)
  VALUES
  (y, namein);
  COMMIT;
END test_proc;
 
PROCEDURE test_proc (numbin  PLS_INTEGER) IS
 y VARCHAR2(30); 
BEGIN
  SELECT MAX(name)
  INTO y
  FROM persons;
 
  local(y, y);
 
  INSERT INTO persons
  (seqno, name)
  VALUES
  (numbin, y);
  COMMIT;
END test_proc;
 
END overload_pkg;
/
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 106 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?