It is impossible to enter data in such a way that they get into the variable when trying to enter the error ORA-02291: integrity constraint (YOZHIK.Oblad_fk2) violated - parent key not found into the table ORA-02291: integrity constraint (YOZHIK.Oblad_fk2) violated - parent key not found If you enter the value manually from selects, everything goes smoothly.
DECLARE Count_Tip number; Count_Firm number; Count_Model number; BEGIN SELECT Max(ID) into Count_Tip FROM "Tip" ; SELECT Max(ID) into Count_Firm FROM "Firm" ; SELECT Max(ID) into Count_Model FROM "Model"; insert into "Oblad"("ID_Tip","ID_Firm","ID_Model","Polomka") Values ( Count_Tip, Count_Model, Count_Firm, 'test4' ); END;
insert into ... select (select max(id) from tip), (select max()...), (select ...), 'test4' from DUALwill do fine - Mike