Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INSERT INTO syntax error SQL

Tags:

sql

mysql

I am at a loss why I am getting this error. It might something 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.

like image 823
koralarts Avatar asked Feb 06 '26 15:02

koralarts


1 Answers

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
like image 84
Michael Berkowski Avatar answered Feb 09 '26 12:02

Michael Berkowski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!