MySQL Forums
Forum List  »  Stored Procedures

Re: Simple stored procedure question
Posted by: Les Stockton
Date: January 13, 2006 10:29AM

Got it to work, as follows:

CREATE PROCEDURE `testcreate`.`MyAddRecord`(IN TblName varchar(50),OUT NewIDVal int)
BEGIN
SET @stmt := CONCAT('INSERT INTO ', TblName, ' () VALUES()');
PREPARE stmt1 FROM @stmt;
EXECUTE stmt1;
SET NewIDVal := LAST_INSERT_ID();
END

Options: ReplyQuote


Subject
Views
Written By
Posted
2439
January 12, 2006 02:06PM
1373
January 12, 2006 03:22PM
1433
January 12, 2006 03:37PM
1433
January 12, 2006 03:54PM
1530
January 12, 2006 04:03PM
1547
January 12, 2006 04:19PM
1503
January 12, 2006 04:46PM
1483
January 12, 2006 05:21PM
Re: Simple stored procedure question
1391
January 13, 2006 10:29AM
1463
January 13, 2006 12:19PM


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.