/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2008 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

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

DECLARE

  l_BG_ID CONSTANT NUMBER := to_number('&1');
  l_exists         varchar2(1) := 'N';

  --
  -- Count the number of invalid objects
  --
  CURSOR csr_get_bg IS
  SELECT 'Y'
  FROM   per_business_groups_perf bg
  WHERE  bg.business_group_id = l_BG_ID;

BEGIN

  --
  -- Check if this business group exists
  --
  OPEN  csr_get_bg;
  FETCH csr_get_bg INTO l_exists;
  CLOSE csr_get_bg;

  dbms_output.put_line(to_char(l_exists));

END;
/
COMMIT;
EXIT;
