 

 
 EXEC P_ALTERPK 'PK_MDS_FCDATATS_KZ', 'T_MDS_FCDATATS_KZ', 'FID', '1';


  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATATS_KZ_NUM') CREATE INDEX IDX_MDS_FCDATATS_KZ_NUM ON T_MDS_FCDATATS_KZ ( frule );
  EXEC P_ALTERPK 'PK_MDS_FCDATATSENTRY_KZ', 'T_MDS_FCDATATSENTRY_KZ', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATATSENTRY_KZ_FID') CREATE INDEX IDX_MDS_FCDATATSENTRY_KZ_FID ON T_MDS_FCDATATSENTRY_KZ ( FID );

   EXEC P_ALTERPK 'PK_MDS_DATEENTRY_KZ', 'T_MDS_DATEENTRY_KZ', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_DATEENTRY_KZ_FID') CREATE INDEX IDX_MDS_DATEENTRY_KZ_FID ON T_MDS_DATEENTRY_KZ ( FID );
 
 
  EXEC P_ALTERPK 'PK_MDS_FPLOG', 'T_MDS_FPLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FPLOG_NUM') CREATE INDEX IDX_MDS_FPLOG_NUM ON T_MDS_FPLOG ( fnumber );
 
 EXEC P_ALTERPK 'PK_MDS_FPLOG_L', 'T_MDS_FPLOG_L', 'fpkid', '1';
  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FPLOG_L') CREATE INDEX IDX_MDS_FPLOG_L ON T_MDS_FPLOG_L ( FID ,FLOCALEID );

