 EXEC P_ALTERPK 'PK_T_ER_KDINVOICECTRLCFG_L', 'T_ER_KDINVOICECTRLCFG_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_KDINVOICECTRLCFG_L_FNAM') CREATE INDEX IDX_ER_KDINVOICECTRLCFG_L_FNAM ON T_ER_KDINVOICECTRLCFG_L ( FNAME );


 EXEC P_ALTERPK 'PK_T_ER_KDINVOICECTRLCFG', 'T_ER_KDINVOICECTRLCFG', 'FID', '1';

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