Counter package : Utility Package « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL>
SQL> create or replace package counter is
  2   procedure reset;
  3   procedure inc;
  4   procedure show;
  5   end;
  6  /

Package created.

SQL> create or replace package body counter is
  2       cnt pls_integer := 0;
  3       procedure reset is
  4       begin
  5           cnt := 0;
  6       end;
  7
  8       procedure inc is
  9       begin
 10          cnt := cnt + 1;
 11       end;
 12
 13       procedure show is
 14       begin
 15           dbms_output.put_line('Execution Count: '||cnt);
 16       end;
 17   end;
 18  /

Package body created.

SQL>
SQL>








27.27.Utility Package
27.27.1.Timer package
27.27.2.Match a date format
27.27.3.Validate all objects in a schema
27.27.4.Process date value
27.27.5.Get full name package
27.27.6.Product check
27.27.7.Check the code version
27.27.8.Audit package
27.27.9.Create a package to handle display, update, delete and insert operations
27.27.10.Counter package