

 EXEC P_ALTERPK 'PK_PMBD_ORGPROS', 'T_PMBD_ORGPROS', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPOS_FNUMBER') CREATE INDEX IDX_PMBD_ORGPOS_FNUMBER ON T_PMBD_ORGPROS ( FNUMBER );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPOS_FCREATETIME') CREATE INDEX IDX_PMBD_ORGPOS_FCREATETIME ON T_PMBD_ORGPROS ( FCREATETIME );
 

 EXEC P_ALTERPK 'PK_PMBD_ORGPROS_L', 'T_PMBD_ORGPROS_L', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPOSL_FID') CREATE INDEX IDX_PMBD_ORGPOSL_FID ON T_PMBD_ORGPROS_L ( FID,FLOCALEID );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPOSL_FNAME') CREATE INDEX IDX_PMBD_ORGPOSL_FNAME ON T_PMBD_ORGPROS_L ( FNAME );
 

 EXEC P_ALTERPK 'PK_PMBD_ORGPROSENTRY', 'T_PMBD_ORGPROSENTRY', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPRY_FID') CREATE INDEX IDX_PMBD_ORGPRY_FID ON T_PMBD_ORGPROSENTRY ( FID );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMBD_ORGPRY_FSEQ') CREATE INDEX IDX_PMBD_ORGPRY_FSEQ ON T_PMBD_ORGPROSENTRY ( FSEQ );
 

