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

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

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PC_GRP') CREATE INDEX IDX_PC_GRP ON T_BD_PROFITCENTER ( FPROFITCENTERGROUPID );


EXEC P_ALTERPK 'PK_BD_PROFITCENTER_L', 'T_BD_PROFITCENTER_L', 'FPKID', '0';

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


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