
Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
| Code: |
|
String cod = jTcodcompra.getText(); try{ bd.entBanco(); bd.stmt.executeUpdate("insert into tempvenda(cod_venda) values ("+cod+") where cod_produto>0"); bd.stmt.executeUpdate("insert into itemvenda (select * from tempvenda)"); bd.stmt.executeUpdate("DELETE from tempvenda"); JOptionPane.showMessageDialog(null, cod); } catch(SQLException e){ //trata os erros JOptionPane.showMessageDialog(this,"Error SQL Cmmd "+e.getMessage()); } new Vendas().show(); this.dispose(); } |
well, found a way to make it work:
String cod = jTcodcompra.getText();
try{
bd.entBanco();
bd.stmt.executeUpdate("insert into itemvenda select cod_venda, cod_produto, nome_produto, preco_produto, quantidade from tempvenda");
bd.stmt.executeUpdate("DELETE from tempvenda");
JOptionPane.showMessageDialog(null, cod);
}
catch(SQLException e){
JOptionPane.showMessageDialog(this,"Error SQL Cmmd "+e.getMessage());
}
I made that problematic insert in another form, alongside the rest of that insert.
now, the problem is that it doesn�t makes more than one insert(more than one product being bought)
so, any solutions?
1 to 2 of 2