 EXEC P_ALTERPK 'PK_FMM_PROCHANGES', 'T_FMM_PROCHANGES', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PROCHANGES_FNUM') CREATE INDEX IDX_FMM_PROCHANGES_FNUM ON T_FMM_PROCHANGES ( FBILLNO );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PROCHANGES_FCT') CREATE INDEX IDX_FMM_PROCHANGES_FCT ON T_FMM_PROCHANGES ( FCREATETIME );
 

 EXEC P_ALTERPK 'PK_FMM_PC_CHANGEDETAIL', 'T_FMM_PC_CHANGEDETAIL', 'FENTRYID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PC_CHANGEDETAIL_FID') CREATE INDEX IDX_FMM_PC_CHANGEDETAIL_FID ON T_FMM_PC_CHANGEDETAIL ( FID );