/*****************************************************************************
*
* Filename         - $Workfile:   get_config_value.sql  $
*
*                     Name         Date       Version     CR Number
*                     Chris Penny  20/11/2003		
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema Stored Procedure
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

PROMPT CREATE OR REPLACE PROCEDURE get_config_value

CREATE OR REPLACE PROCEDURE get_config_value (
     p_dbitem  IN   db_config.db_item%TYPE
   , p_dbvalue OUT  db_config.db_value%TYPE
   , retval    OUT  error.error_id%TYPE
) 
AS 

   l_dbvalue db_config.db_value%TYPE := '';

BEGIN

   retval := 0;

   SELECT NVL(db_value,l_dbvalue)
   INTO   p_dbvalue
   FROM   db_config
   WHERE  db_item = p_dbitem;


EXCEPTION

    WHEN NO_DATA_FOUND THEN
        retval := -502;   /* Database Error: FAIL */

END get_config_value;
/
