After inserting a record, I use select max(IDControle)
to retrieve the table id to record the items.
When the time is only 1 second, I noticed that the items were all recorded in the 1st record. Does anyone have any idea how this could be avoided?
insert into TB_C_ORCAMENTO (descricaosituacao) values ('exemplo');
select max(controle) from TB_C_ORCAMENTO;
insert into TB_D_ORCAMENTO (controle, descricaoproduto) values (10, 'teste');