/**Begin D:\PDM_UPGRADE\pdmnew\BASE_constraint.sql **/
EXEC P_ALTERPK 'PK_BD_PROFITCENTERGROUP', 'T_BD_PROFITCENTERGROUP', 'FID', '0';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PCGROUP_ORG') CREATE INDEX IDX_PCGROUP_ORG ON T_BD_PROFITCENTERGROUP ( FCREATEORGID );


EXEC P_ALTERPK 'PK_BD_PROFITCENTERGROUP_L', 'T_BD_PROFITCENTERGROUP_L', 'FPKID', '0';

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


EXEC P_ALTERPK 'PK_BD_PROFITCENTERGRPENTRY', 'T_BD_PROFITCENTERGRPENTRY', 'FENTRYID', '0';

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



/**End D:\PDM_UPGRADE\pdmnew\BASE_constraint.sql **/
