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

SET FEEDBACK OFF
SET SERVEROUT ON

DECLARE

  l_sql    varchar2(400);
  l_result varchar2(400);

BEGIN

  --
  -- Fetch the schema using dynamic SQL in case
  -- the table does not exist, ie, a fresh install.
  --
  l_sql := ' SELECT custom_schema '
        || ' FROM   xxas_com_install ';
  
  EXECUTE IMMEDIATE l_sql INTO l_result;

  dbms_output.put_line(l_result);

EXCEPTION

  WHEN others THEN
    --
    -- Table does not exist, first-time install has not been run
    --
    null;
 
END;
/
COMMIT;
EXIT;
