views:

631

answers:

1

Hi All,

I am creating database at runtime and I want to create the tables in that database at the same time. can anyone give me any thought on how to do that? For Example - I have created one database named 'mydb' and now in the same proess i am trying to create the table i am using the mysql stored procedure for the same. my proc input will be my dbname. so, my proc looks like

create procedure test(IN dbname varchar(100)) begin create table dbname.testing(testid int, testname varchar(45)); end

+2  A: 

You can use the PREPARE feature to execute dynamic SQL.

Cade Roux