 EXEC P_ALTERPK 'PK_POM_XMANUSTOCKENTRY_LK', 'T_POM_XMANUSTOCKENTRY_LK', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMANUSTOCKENTRY_LK_FK') CREATE INDEX IDX_POM_XMANUSTOCKENTRY_LK_FK ON T_POM_XMANUSTOCKENTRY_LK ( FDETAILID );

 EXEC P_ALTERPK 'PK_POM_XMFTORDERENTRY_S_LK', 'T_POM_XMFTORDERENTRY_S_LK', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFTORDERENTRY_S_LK_FK') CREATE INDEX IDX_POM_XMFTORDERENTRY_S_LK_FK ON T_POM_XMFTORDERENTRY_S_LK ( FENTRYID );

 EXEC P_ALTERPK 'PK_POM_XMFTORDERENTRY_S_TC', 'T_POM_XMFTORDERENTRY_S_TC', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFTORDERENTRY_S_TC_TBILL') CREATE INDEX IDX_POM_XMFTORDERENTRY_S_TC_TBILL ON T_POM_XMFTORDERENTRY_S_TC ( FTBILLID );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFTORDERENTRY_S_TC_TID') CREATE INDEX IDX_POM_XMFTORDERENTRY_S_TC_TID ON T_POM_XMFTORDERENTRY_S_TC ( FTID );
 
 EXEC P_ALTERPK 'PK_POM_XMFTORDERENTRY_S_WB', 'T_POM_XMFTORDERENTRY_S_WB', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFTORDERENTRY_S_WB_FK') CREATE INDEX IDX_POM_XMFTORDERENTRY_S_WB_FK ON T_POM_XMFTORDERENTRY_S_WB ( FID );
