开发者

INSERT INTO syntax error SQL

I am at a loss why I am getting this error. It might 开发者_如何学Csomething I can't see in my syntax so any help would be greatly appreciated.

STATEMENT

INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, 
                        attached_docs, doc_explain, age_met, age_explain, 
                        years_met, years_explain, severity, severity_explain, 
                        restriction, restriction_explain, require, require_explain) 
VALUES(410, DATE '2009-12-10', 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
       'Dr M Beaulieu has provided further information indicating that applicant is severly ill and disabled. Applican''t condition is confirmed as rectal adenocarcinoma, she has endured dhemo and readiation therapy and is under care of the Oncology Team, surgeon and GP.', 0,
       'Information from Dr states that applicant is unable to sit, has great difficulty walking and requires ongoing support from the Community Support Services',
       0, NULL);

ERROR

1064 - 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 'require,require_explain) VALUES(410,DATE '2009-12-10',0,NULL,0,NULL,0,NULL,0,NUL' at line 1

Thanks.


REQUIREis a reserved MySQL keyword. You must enclose it in backquotes as:

`require`

Also, it's worth pointing out that MySQL escapes single quotes with a backslash, not two single-quotes like SQL Server and Access. This phrase may become problematic if the above is your exact SQL statement and that single quote has not been escaped:

Applican''t condition


it's because "require" is a keyword backtick it.


I copy-pasted your query to MySQL Workbench, and it seems that you are using reserved require keyword as a name of a table column, to fix that:

INSERT INTO pwd_review (id, request_date, being_reviewed, review_explain, 
                        attached_docs, doc_explain, age_met, age_explain, 
                        years_met, years_explain, severity, severity_explain, 
                        restriction, restriction_explain, `require`, require_explain) 
VALUES(410, DATE '2009-12-10', 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
       'Dr M Beaulieu has provided further information indicating that applicant is severly ill and disabled. Applican''t condition is confirmed as rectal adenocarcinoma, she has endured dhemo and readiation therapy and is under care of the Oncology Team, surgeon and GP.', 0,
       'Information from Dr states that applicant is unable to sit, has great difficulty walking and requires ongoing support from the Community Support Services',
       0, NULL);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜