Jump to content

MySQL Creating a table with a random name within a stored procedure?


homiee

Recommended Posts

Hey,Assuming I have a stored procedure:CREATE DEFINER=`localhost`@`%` PROCEDURE `sp_find_route`(IN a_start_point int, IN a_end_point int)BEGIN CREATE TABLE tableName ( level INT, route VARCHAR(255), owneruserid int, frienduserid int);Assuming I want that each time the SP is called tableName will change to a random 6 digits / characters name, is it possible?Thanks in advance,homiee

Link to comment
Share on other sites

Yeah but still how do I use that random number?I've triedDECLARE randomTableName VARCHAR(10);SET randomTableName ="aSdzXdsaS";CREATE TABLE randomTableName (...)but still it creates a table called randomTableName ...:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...