/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_constraint.sql **/
 EXEC P_ALTERPK 'PK_TPO_TCCIT_BIZDEF', 'T_TPO_TCCIT_BIZDEF', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_TCCIT_BIZDEF_ENTRY', 'T_TPO_TCCIT_BIZDEF_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_TCCIT_BIZDEF_ENTRY') CREATE INDEX IDX_TPO_TCCIT_BIZDEF_ENTRY ON T_TPO_TCCIT_BIZDEF_ENTRY ( FNUMBER ,FVALIDFROM ,FEXPIRED );


 EXEC P_ALTERPK 'PK_TPO_TCCIT_BIZDEF_L', 'T_TPO_TCCIT_BIZDEF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_TCCIT_BIZDEF_TREE', 'T_TPO_TCCIT_BIZDEF_TREE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_TCCIT_BIZDEF_TREE_L', 'T_TPO_TCCIT_BIZDEF_TREE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_ASSETLOSSMAP', 'T_TPO_ASSETLOSSMAP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_ASSETLOSSMAP_L', 'T_TPO_ASSETLOSSMAP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_ASSETLOSSMAP_TREE', 'T_TPO_ASSETLOSSMAP_TREE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TPO_ASSETLOSSMAP_TREE_L', 'T_TPO_ASSETLOSSMAP_TREE_L', 'FPKID', '1';

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



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