/*****************************************************************************
*
* Filename         - $Workfile:   get_bag_count.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema Stored Procedure
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   get_bag_count.sql  $  $Revision:   1.4  $
*
* Revision History
*
* Note that user tagtrak is many users. For these users the user
* name is entered as the last line in the change description.
*
* $Log:   /shared/pvcs/tagtarch/db_ora/db/source/live/procedures/get_bag_count.sqv  $
* 
*    Rev 1.4   02 Apr 1998 19:34:46   tagtrak
* OR:
* CR:
* REV:
* Initial Issue
* See label for concession
* 
*    Rev 1.3   15 Jan 1998 12:12:28   tagtrak
* OR: OR11101, TN13, TN15
* CR:
* REV:
* Phase 2C to Phase 3 upgrade plus code review actions and resolving some technical isses.
* 
*    Rev 1.2   24 Oct 1997 11:08:20   tagtrak
* Added PVCS header information
*
****************************************************************************/

PROMPT create or replace procedure get_bag_count

create or replace procedure get_bag_count (
	fid     in out  number,
	no_chkd out     number,
	no_ldd  out     number
) 

as  
begin

	/*
	 * - Initialise Variables
	 * - If the fid parameter > 0 then
	 *   Select the bags_checked and bags_loaded from the flight_status
	 *   table where the flight_id equals the fid parameter
	 */

	no_chkd := -1;
	no_ldd  := -1;
 
	if (fid > 0) then 
		select
			bags_checked,
			bags_loaded 
		into
			no_chkd,
			no_ldd 
		from
			flight_status
		where
			flight_id = fid;
	end if;
 
end get_bag_count;
/
