[英]MySQL: Syntax error while creating a table
I wanted to create a new table, but I have a syntax error somewhere. 我想创建一个新表,但是某处存在语法错误。 However I do not see where, no matter how often I look over it.
但是,无论我多久查看一次,我都看不到哪里。
Can anybody spot my error? 有人可以发现我的错误吗?
Dim cmdCreate As New MySqlCommand("CREATE TABLE inout (inout_seacher TEXT,inout_guid TEXT,inout_blob LONGBLOB,inout_inouttype INTEGER,inout_automaticallyparsed TINYINT(1)," & _
"inout_price DOUBLE,inout_companyguid TEXT,inout_datetime TEXT,inout_title TEXT,inout_catid INTEGER,inout_vat INTEGER,inout_banktype INTEGER," & _
"inout_banktransferprice DOUBLE,inout_expenseinvoiceexistsinguid TEXT,inout_orderguid TEXT,inout_inoutsubtype INTEGER,inout_outinvoicetype INTEGER)", g_CnWebDB)
Thank you for the help! 感谢您的帮助!
Bad luck. 厄运。 Believe it or not 'inout' is a reserved word in MySQL.
信不信由你,“ inout”是MySQL中的保留字。 Either wrap it in backticks (`) or (better) call it something else.
将其包装在反引号(`)中,或将其更好地命名为其他名称。 Also, are you sure you want DOUBLE and not DECIMAL?
另外,您确定要双重而不是十进制吗?
"inout" is reserved word. “ inout”是保留字。 Try other name for the table.
为该表尝试其他名称。 You can also quote the table's name using (
), so (
inout`) becomes acceptable. 您也可以使用(
), so (
引用表名), so (
inout`)可以接受。
As Strawberry already said, is a reserved word used for procedures; 正如草莓已经说过的,它是程序的保留字; directly from MySQL.com:
直接从MySQL.com:
As of MySQL 5.0.30, stored procedures that take no arguments can be invoked without parentheses.
从MySQL 5.0.30开始,可以在不带括号的情况下调用不带参数的存储过程。 That is, CALL p() and CALL p are equivalent.
也就是说,CALL p()和CALL p是等效的。
CALL can pass back values to its caller using parameters that are declared as OUT or INOUT parameters.
CALL可以使用声明为OUT或INOUT参数的参数将值传递回其调用方。 When the procedure returns, a client program can also obtain the number of rows affected for the final statement executed within the routine: At the SQL level, call the ROW_COUNT() function;
当过程返回时,客户端程序还可以获得在例程中执行的最终语句所影响的行数:在SQL级别,调用ROW_COUNT()函数;在SQL级别上,调用ROW_COUNT()函数。 from the C API, call the mysql_affected_rows() function.
从C API中,调用mysql_affected_rows()函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.