Use of 'get' and 'set' prefixes : Package Body « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE PACKAGE myDate
  2  IS
  3     PROCEDURE set_mydate (date_in IN DATE);
  4     FUNCTION get_mydate RETURN DATE;
  5  END myDate;
  6  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY myDate
  2  IS
  3     g_mydate DATE;
  4
  5     PROCEDURE set_mydate (date_in IN DATE)
  6     IS
  7     BEGIN
  8        g_mydate := date_in;
  9     END;
 10
 11     FUNCTION get_mydate RETURN DATE
 12     IS
 13     BEGIN
 14        RETURN g_mydate;
 15     END;
 16  END myDate;
 17  /

Package body created.

SQL>
SQL>








27.11.Package Body
27.11.1.Package with only one function
27.11.2.Package with two procedures
27.11.3.Package declaration and body
27.11.4.Use of 'get' and 'set' prefixes
27.11.5.Use package method in a procedure
27.11.6.Call function in a Package
27.11.7.Method overload
27.11.8.Package method overloading
27.11.9.Reference method from another package
27.11.10.Package Function with 'PRAGMA AUTONOMOUS_TRANSACTION'
27.11.11.Create a package containing stored procedure DELETE_ORDERS and stored function GET_employee_NAME.
27.11.12.Package initialization.
27.11.13.Use package member variable to pass value