Reputation: 41
MySQL gives me syntax error for a simple query but I don't see any error. If you guys find any please help.
insert into cast(sid,celeb_id,type,name,prior)
values(30,1,1,'James Keziah Delaney',2)
It gives sql syntax error near cast
.
Upvotes: 2
Views: 66
Reputation: 46219
The main cause of this error is that there is a function Cast in mysql.
It look like to call the cast()
function.
You can choose one of the solutions to solve it.
look like this.
insert into `cast`(sid,celeb_id,type,name,prior) values(30,1,1,'James Keziah Delaney',2)
cast
and (
let mysql know you did't want to execute Cast method. thank for @Barmar remind.Note:
I would suggest you don't give the table name from keyword or function name.
Upvotes: 5
Reputation: 3886
You can't insert into cast(). It requires a list of column names.
Upvotes: 0