PL/SQL allows you to overload programs in a package. Overloading means that two or more programs have the same name but different parameter variables, parameter order, or parameter data types. When you call an overloaded program, the system selects the program based on the type of the input parameters.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
The following example shows a package header. The function query_obdept can be called by passing a numeric or string parameter. The function is implemented in the package body.
CREATE OR REPLACE PACKAGE obdemo_pack1
IS
DeptRec obdept%ROWTYPE;
v_sqlcode NUMBER;
v_sqlerr VARCHAR2(2048);
FUNCTION query_obdept(dept_no IN NUMBER)
RETURN INTEGER;
FUNCTION query_obdept(dept_no IN VARCHAR2)
RETURN INTEGER;
END obdemo_pack1;
/
