/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_constraint.sql **/
 EXEC P_ALTERPK 'PK_TPO_STANDINGBOOK_DETAIL', 'T_TPO_STANDINGBOOK_DETAIL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_STANDINGBOOK_DETAIL_L', 'T_TPO_STANDINGBOOK_DETAIL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_STANDINGBOOK_DETAIL_L') CREATE INDEX IDX_TPO_STANDINGBOOK_DETAIL_L ON T_TPO_STANDINGBOOK_DETAIL_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TPO_STANDINGBOOK_ITEMS', 'T_TPO_STANDINGBOOK_ITEMS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_STANDINGBOOK_ITEMS') CREATE INDEX IDX_TPO_STANDINGBOOK_ITEMS ON T_TPO_STANDINGBOOK_ITEMS ( FNUMBER );


 EXEC P_ALTERPK 'PK_TPO_STANDINGBOOK_ITEMS_L', 'T_TPO_STANDINGBOOK_ITEMS_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_STANDINGBOOK_ITEMS_L_0') CREATE INDEX IDX_TPO_STANDINGBOOK_ITEMS_L_0 ON T_TPO_STANDINGBOOK_ITEMS_L ( FID ,FLOCALEID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_constraint.sql **/
