Author Topic: Mysql Create Table  (Read 2573 times)

oppiniated

  • New Poster
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Mysql Create Table
« on: June 04, 2009, 02:55:00 PM »
Hello All,
Have another(wierd) problem  :wink:

I need to create a table `test_table_1` where '1' is the value returned by MySql's "LAST_INSERT_ID()" function.

So suppose I insert a record into a table temp_table then if i Execute

Code: [Select]
SET @IDX=(SELECT LAST_INSERT_ID() FROM temp_table LIMIT 1);
CREATE TABLE test_table_@IDX(id INTEGER)

at the MySql Prompt,it does not work and gives an error
Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@idx(`id` integer)' at line 1
Is Something like this possible in Mysql.
I need to do this only through Mysql query

Thanks in advance..