/*****************************************************************************
*
* Filename         - $Workfile:   get_ldg_strat.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 get_ldg_strat  - 
*                    Reinstated for Oracle port to allow bag_load to
*                    check the loading strategy is valid.
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   get_ldg_strat.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_ldg_strat.sqv  $
* 
*    Rev 1.4   02 Apr 1998 19:35:58   tagtrak
* OR:
* CR:
* REV:
* Initial Issue
* See label for concession
* 
*    Rev 1.3   15 Jan 1998 12:12:54   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:11:42   tagtrak
* Added PVCS header information
*
****************************************************************************/


PROMPT create or replace procedure get_ldg_strat

create or replace procedure get_ldg_strat (
	ls_code in     char,
	rv         out integer,
	ls_name in out char
)

as
 
begin

	/*
	 * - Initialise variables
	 * - Select the ldg_strat_name from the ldg_strat table where the
	 *   ldg_strat_code is equal to the ls_code parameter.
	 * - If the ls_name parameter is equal to '-' then
	 *   return value = -1014
	 * - If no data found then
	 *   return value = -1014 and ls_name = '-'
	 */

	rv      := 0;
	ls_name := '-';
 
	select
		ldg_strat_name
	into
		ls_name
	from
		ldg_strat
	where
		ldg_strat_code = ls_code;

	if (ls_name = '-') then
		rv := -1014;
	end if;

	exception
		when NO_DATA_FOUND then
			rv      := -1014;
			ls_name := '-';

end get_ldg_strat;
/
