MySQL Forums
Forum List  »  Stored Procedures

Stored Proceedure Variable Questions
Posted by: Martin Weaver
Date: May 27, 2017 05:22PM

Ok this question should be relatively simple.

MySQL, using a stored procedure, can you use the variable you are inputting as a table name in a create statement inside the stored procedure?


Here is what i have written thus far:

CREATE PROCEDURE Back_table(IN tblnme CHAR(15))
BEGIN
Create Table tblnme (stored VARCHAR(20), backed VARCHAR(20),
logged int, pallet CHAR(5), tray char (5), tag int);
END //

When i execute the stored procedure it creates a table with the name tblnme, but i want it to use the char input as the file name. So what did i miss here?

Options: ReplyQuote


Subject
Views
Written By
Posted
Stored Proceedure Variable Questions
291
May 27, 2017 05:22PM


Sorry, only registered users may post in this forum.

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.