spool all_oco_policies.rslt 

set linesize 130;
set pagesize 1000;
set long 50;
set echo on;

break on "TABLE" on "Policy Name";

/* ****************************************************** */
/*                                                        */
/*  - will show all the POLICIES for a given database     */
/*     - for use with CONTEXT CARTRIDGES                  */
/*                                                        */
/* ****************************************************** */

select  substr(POL_TABLENAME,1,15)		"TABLE",
        substr(pol_name,1,30)              	"Policy Name",
        substr(POL_KEY_NAME,1,15)			"Prim. Key",
        substr(POL_TEXT_EXPR,1,15)		"Context Field",
    	  substr(to_char(POL_ID, '09999'), 1,7)  "ID",
   	  substr(to_char(POL_DOCID_COUNT, '999,999'), 1,9)  "ROW CNT",
        substr(POL_DESC,1,25)              	"Policy Desc",
	  substr(POL_STATUS,1,8)					"STATUS"
from ctxsys.ctx_policies 
order by 1 asc, 2 asc;



set echo off;
spool off;
set long 80;
commit;









