title: How to create stored procedure in mysql and call it in JAVA. i need some help on creating a callable procedure. below id my code
body: <pre><code> drop PROCEDURE if exists insert_poo;
   DELIMITER $$
  
   CREATE PROCEDURE insert_poo(IN barcode varchar(250),IN qty float,IN amount float,IN vat float,IN 
  description varchar(250),IN clrk_code varchar(20),IN mechno varchar(20),IN bill_date datetime)
  BEGIN
  DECLARE unit_pric float;
  DECLARE itemcode varchar(150);
  SET  unit_pric =(select retail1 FROM `mytable` WHERE  `mytable`.barcode = barcode);
  SET  itemcode =(select prod_id FROM `mytable` WHERE `mytable`.barcode = barcode);
  INSERT into mytable2(clrk_code,tran_code,tran_desc,tran_qty,unit_price,tran_amt,bill_date,tax)values(clrk_code,barcode,description,qty, unit_pric,amount,bill_date,vat)
  
  END $$
  DELIMITER ;
  </code></pre>
  
  <p>Kindly help with any solution on how to create and call it. thanks in advance</p>