IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_EXPENSE_DETAIL_DATA' AND KSQL_INDNAME = 'IDX_ER_EXPENSEDETAIL')
 CREATE INDEX IDX_ER_EXPENSEDETAIL ON T_ER_EXPENSE_DETAIL_DATA (FCOMPANY ,FCOSTCOMPANY ,FCURRENCY ,FCOSTDEPT );