/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 |   This script inserts value into XXAS_OUT_DB_NAME profile if it is null    |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE
  l_db_name     fnd_profile_option_values.profile_option_value%TYPE;
  ret           boolean;
BEGIN
  l_db_name := upper(fnd_profile.value('XXAS_PUSH_NTF_DB_NAME'));
  IF l_db_name is null or l_db_name <> xxas_util_pkg.db_name THEN
    ret := fnd_profile.save('XXAS_PUSH_NTF_DB_NAME',xxas_util_pkg.db_name,'SITE');
  END IF;
  EXCEPTION WHEN others THEN
    NULL;
END;
/
COMMIT;
EXIT;