MySql and Parameters...
This code in my program:
string commandString = "CREATE TABLE ?pTable (ID BIGINT(20) AUTO_INCREMENT NOT NULL, SHAPE POINT NOT NULL," +
" PRIMARY KEY(ID), SPATIAL KEY (SHAPE)) ENGINE=MyISAM AUTO_INCREMENT=1";
MySqlCommand command = new MySqlCommand(commandString, conn);
command.Parameters.Add("pTable", "Table1");
command.ExecuteNonQuery();
Launch this exception:
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
syntax to use near ''FeatureClass1' (ID BIGINT(20) AUTO_INCREMENT NOT NULL, SHAPE POINT NOT NULL, PR' at line 1
Please note '' in near ''FeatureClass1' ...
But if from query builder i use:
CREATE TABLE Table1 (ID BIGINT(20) AUTO_INCREMENT NOT NULL, SHAPE POINT NOT NULL, PRIMARY KEY(ID), SPATIAL KEY (SHAPE)) ENGINE=MyISAM AUTO_INCREMENT=1
all works correctly; but:
CREATE TABLE 'Table1' (ID BIGINT(20) AUTO_INCREMENT NOT NULL, SHAPE POINT NOT NULL, PRIMARY KEY(ID), SPATIAL KEY (SHAPE)) ENGINE=MyISAM AUTO_INCREMENT=1
launch the same exception of my code.
Any suggestions?
Subject
Written By
Posted
MySql and Parameters...
February 02, 2005 06:48AM
February 02, 2005 06:56PM
February 03, 2005 11:01AM
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.