MySQL Forums
Forum List  »  Docs

Re: MySQL Tutorial: LAST_INSERT_ID()
Posted by: kamal patel
Date: March 08, 2007 10:14PM

How I can Insert tow table data?
This are tables
Products
Products_description

I am not good in stored procedure. I wrote following code, but it did not work.
Can any body help me?


DELIMITER $$

DROP PROCEDURE IF EXISTS `esale`.`PRODUCTSs` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `PRODUCTSs`()
BEGIN
insert into products(products_id,products_price)
values(NULL,200);
commit;
insert into products_description(products_id,products_name)
values(LAST_INSERT_ID(),'Paper');
commit;
END $$


Thanks,

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
65884
September 14, 2004 07:43AM
23706
October 18, 2004 08:50AM
17918
December 16, 2004 12:15AM
Re: MySQL Tutorial: LAST_INSERT_ID()
14228
March 08, 2007 10:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.