/*============================================================================*
 |                 Copyright (c) 2008 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/
 
SET FEEDBACK OFF
SET VERIFY OFF
SET SERVEROUT ON

DECLARE

  l_sql        varchar2(400);
  l_rc_status    varchar2(400) := 'DISABLED';
  
BEGIN

  --
  -- Retrieve the current Result Cache status
  --
  l_sql := ' SELECT ''ENABLED'' '
		|| ' FROM DUAL '
		|| ' WHERE EXISTS (SELECT 1 '
		|| ' FROM V$PARAMETER '
		|| ' WHERE NAME=''result_cache_max_size''	' 
		|| ' AND VALUE>''0'')';
		
	EXECUTE IMMEDIATE l_sql INTO l_rc_status;

	dbms_output.put_line(l_rc_status);

EXCEPTION

  WHEN others THEN
    --
    -- Result Cache is DISABLED
    --
    dbms_output.put_line(l_rc_status);

END;
/
COMMIT;
EXIT;