/*****************************************************************************
*
* Filename         - $Workfile:   update_bag.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, 2000
*
*****************************************************************************/

PROMPT CREATE OR REPLACE FUNCTION update_bag

CREATE OR REPLACE 
FUNCTION update_bag (bagtag IN CHAR
										,bagsequenceno IN NUMBER
										) RETURN BOOLEAN IS
BEGIN

	UPDATE bag
	SET	bag_sequence_no = bagsequenceno
	WHERE bag_tag = bagtag;

	IF SQL%NOTFOUND THEN
		RETURN FALSE;
	ELSE
  	RETURN TRUE;
	END IF;

EXCEPTION
	WHEN OTHERS THEN
		RETURN FALSE;
END update_bag;
/
