/*****************************************************************************
*
* Filename         - $Workfile:   pax_id.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:   pax_id.sql  $  $Revision:   1.5  $
*
* 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/pax_id.sqv  $
* 
*    Rev 1.5   25 Sep 1998 10:04:46   tagtrak
* OR: 12484
* CR: 12484
* REV:
* Merged Vienna (0.3.1E) and Core Product (0.2.5E) -
* branch ATS revision moved to trunk.
* Andrew Walker
* 
*    Rev 1.4.2.0   18 Aug 1998 09:35:08   tagtrak
* OR: 12484
* CR: 12484
* REV:
* Merging Vienna (0.3.1E) and Core Product (0.2.5E).
* Andrew Walker
* 
*    Rev 1.4.1.0   04 Jun 1998 15:32:40   tagtrak
* OR:
* CR: 12098
* REV:
* Vienna Modifications
* Andrew Walker
* 
*    Rev 1.4   02 Apr 1998 19:37:40   tagtrak
* OR:
* CR:
* REV:
* Initial Issue
* See label for concession
* 
*    Rev 1.3   15 Jan 1998 12:13:56   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:19:06   tagtrak
* Added PVCS header information
*
****************************************************************************/

PROMPT create or replace procedure pax_id

create or replace procedure pax_id (
	fltid in   number,
	seqno in   number,
	paxid out  number
) 
as  
begin

	/*
	 * - Initialise variable
	 * - Select the pax_id from the pax table where the sequence number
	 *    and flight_id is the same as the parameters passed in, and the
	 *    delete marker is not equal to 1.  If no data is found, the
	 *    return a NULL.
	 */

	paxid := 0;
 
	select
		pax_id 
	into
		paxid 
	from
		pax
	where
		pax_sequence_no = seqno and
		flight_id       = fltid and
		delete_marker  != 1; 

	exception
		when NO_DATA_FOUND then
			null;

end pax_id;
/
