CREATE OR REPLACE PACKAGE locations_pkg AS
/******************************************************************************
 *
 * Public Type Definitions
 *
 ******************************************************************************/

   -- Define the types of record sets (for the MWS)
   TYPE loc_group_description_type IS
      TABLE OF location_group.description%TYPE       INDEX BY BINARY_INTEGER;
   TYPE location_group_type        IS
      TABLE OF VARCHAR2(2)                           INDEX BY BINARY_INTEGER;

   -- This variable limits the number of rows that each stored procedure will return
   -- by default the MWS will only display 999 rows
   MAX_ROWS integer := 99999;
   
/******************************************************************************
 *
 * PROCEDURE get_location_groups
 *
 * Description:
 *
 * This procedure returns the location_groups for display on the MWS.
 *
 * Parameters:
 *
 * p_site_id               - site ID to return location groups for
 * p_location_group        - returned location_group
 * p_location_description  - returned location_description
 *
 ******************************************************************************/

PROCEDURE get_location_groups
(
   p_site_id               IN location_group.site_id%TYPE,
   p_location_group        OUT location_group_type,
   p_location_description  OUT loc_group_description_type
);

/******************************************************************************
 *
 * PROCEDURE create_location_group
 *
 * Description:
 *
 * This procedure creates a new location group.
 *
 * Parameters:
 *
 * p_site_id               - site ID to return location groups for
 * p_name                  - returned location_group
 * p_description           - returned location_description
 * p_last_user             - the tagtrak user ID of the last user to modify this
 * p_out_row_id            - appn row ID of the created location group
 *
 ******************************************************************************/

PROCEDURE create_location_group
(
   p_site_id               IN location_group.site_id%TYPE,
   p_name                  IN location_group.name%TYPE,
   p_description           IN location_group.description%TYPE,
   p_last_user             IN location_group.last_user%TYPE,
   p_out_row_id            OUT location_group.appn_row_id%TYPE
);

/******************************************************************************
 *
 * PROCEDURE edit_location_group
 *
 * Description:
 *
 * This procedure updates an existing location group.
 *
 * Parameters:
 *
 * p_appn_row_id           - the appn row ID of the location group to edit
 * p_description           - returned location_description
 * p_last_user             - the tagtrak user ID of the last user to modify this
 *
 ******************************************************************************/

PROCEDURE edit_location_group
(
   p_appn_row_id           IN location_group.appn_row_id%TYPE,
   p_description           IN location_group.description%TYPE,
   p_last_user             IN location_group.last_user%TYPE
);


END locations_pkg;
/