< Prev - Documentation - Next >

Naming Convention

The classes, methods, attributes and arguments are named in camel case convention of the PL/SQL function, procedure, package, object and parameter name.

Example : Transfer Object

Object Type Specification : COL_OBJECT
 * Object type with three fields of date, timestamp and varchar2.
create or replace type col_object force as object (
  d           date,
  ts          timestamp,
  s           varchar2(100)

Example : Collection

Collection Table Type : TABLE_OF_COL_OBJECT
 * Table of type col_object. 
create or replace type table_of_col_object as table of col_object;

Example : PL/SQL Procedure

create or replace procedure collections_of_objects
  i_delta_d         in    number,
  i_delta_ts        in    number,
  i_col_objects     in    table_of_col_object,
  o_col_objects     out   table_of_col_object
 * Demonstration of calling a stored procedure with input of table of object elements. The elements are modified and returned as out put parameter.
 * @param i_delta_d Offset is added to date value.
 * @param i_delta_ts Offset is added to timestamp value.
 * @param i_col_objects Input list of collection objects.
 * @param o_col_objects Output list of collection objects.
  -- initialize output collection
  o_col_objects := table_of_col_object();

  -- append elements to collection
  for i in 1..i_col_objects.count loop
    o_col_objects(i) := col_object(i_col_objects(i).d + i_delta_d + i, i_col_objects(i).ts + i_delta_ts + i, i_col_objects(i).s || ' - ' || DBMS_RANDOM.string('A',10));
  end loop;
end collections_of_objects;

< Prev - Documentation - Next >