/*****************************************************************************
*
* Filename         - $Workfile:   get_timeout.sql  $
*
*                     Name              Date      Version     CR NUMBER
* Author           - Mark Paprocki
*
* 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 1998
*
*****************************************************************************/

PROMPT CREATE OR REPLACE PROCEDURE get_timeout

CREATE OR REPLACE PROCEDURE get_timeout
(
   in_kit_type       IN  CHAR,
   out_timeout_value OUT NUMBER
)
AS
   default_timeout CONSTANT NUMBER(2) := 60; /* if no database value, this is default */
BEGIN

   out_timeout_value := 0;

   SELECT timeout /* in minutes... */
     INTO out_timeout_value
     FROM kit_type
    WHERE RTRIM(type) = in_kit_type;

   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         out_timeout_value := default_timeout;

      WHEN OTHERS THEN
         out_timeout_value := default_timeout;

END get_timeout;
/
