MySQL Forums
Forum List  »  Stored Procedures

Re: Simple stored procedure question
Posted by: Les Stockton
Date: January 12, 2006 04:46PM

I ended up calling the procedure, but now it says there's a syntax error at or near [?]

I tried it with DEFAULT. I tried without DEFAULT.
So what's wrong with:
PREPARE stmt1 FROM 'INSERT INTO [?] ';

Currently, this is the stored procedure:

CREATE PROCEDURE `MyAddRecord`(IN TblName varchar(50),OUT NewIDVal int)
BEGIN
PREPARE stmt1 FROM 'INSERT INTO [?] ';
SET @a = TblName;
EXECUTE stmt1 USING @a;
SET NewIDVal = LAST_INSERT_ID();
END

So what do I need to do with the PREPARE statement or the INSERT within it?




Edited 1 time(s). Last edit at 01/12/2006 04:52PM by Les Stockton.

Options: ReplyQuote


Subject
Views
Written By
Posted
2439
January 12, 2006 02:06PM
1373
January 12, 2006 03:22PM
1432
January 12, 2006 03:37PM
1433
January 12, 2006 03:54PM
1529
January 12, 2006 04:03PM
1547
January 12, 2006 04:19PM
Re: Simple stored procedure question
1501
January 12, 2006 04:46PM
1483
January 12, 2006 05:21PM
1391
January 13, 2006 10:29AM
1462
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.