 EXEC P_ALTERPK 'PK_T_BD_CTRLASSISTDATA_L', 'T_BD_CTRLASSISTDATA_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_T_BD_CTRLASSISTDATATYPE_L', 'T_BD_CTRLASSISTDATATYPE_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_T_BD_CTRLASSISTDATATYPE', 'T_BD_CTRLASSISTDATATYPE', 'FID', '1'; 

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTRLASSISTDATATYPE_NUMBER') CREATE INDEX IDX_CTRLASSISTDATATYPE_NUMBER ON T_BD_CTRLASSISTDATATYPE ( FNUMBER );
 
 EXEC P_ALTERPK 'PK_T_BD_CTRLASSISTDATA', 'T_BD_CTRLASSISTDATA', 'FID', '1'; 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTRLASSISTDATA_NUMBER') CREATE INDEX IDX_CTRLASSISTDATA_NUMBER ON T_BD_CTRLASSISTDATA ( FNUMBER );