My Store procdure not return result
Posted by:
Dong Feng
Date: February 08, 2006 03:40PM
I create store procedure as blow
CREATE PROCEDURE `Add_Test`(in sName varchar(40),in nUserID int)
BEGIN
declare nCompanyID INTEGER default -1;
declare continue handler for sqlexception Rollback;
start transaction;
Insert into Company (Company_Name,Address_Type,Status,Notes,User_ID,Last_Modify,Type,Web_Site,Phone,Email,Fax,Cell,Create_Time,Create_By)
values (sName,'','A','',nUserID,now(),'C','','','','','',now(),nUserID);
commit;
Set nCompanyID = LAST_INSERT_ID();
Select * from Company where company_id = nCompanyID;
END $$
company_id is auto inc.
after I insert the record, the select statment not get any result?
Any help for me? I user default isolation leve for mysql.
MySQL version is 5.0.18