Getting Error 1064 when trying to insert a row with 0 value

I’m getting Error #1064 when i try to insert a record with 0 in a decimal field (the field name is “estimation”) into my table.

This is my query:

insert into needs(id_org,date_created,date_required,place_required,description,contact,phone,email, remarks, cur_id,estimation,user_id)
values(2,'2011-01-31','2011-02-07','Place','test','Tom Jones','111-1234','','test',,0,2)

This query works if the ‘estimation’ field has any other value except 0.

Note that ‘estimation’ is set to DECIMAL(10,2)

Can anyone assist??

you aren’t entering a value for cur_id, does it have a default value for the column?

you can’t have two commas in a row like that

The default value for cur_id is NULL. The datatype is Integer.

Then you either need to leave it out entirely or use NULL.

Left out:


insert into needs(
id_org, 
date_created,
date_required,
place_required,
description,
contact,
phone,
email, 
remarks, 
estimation,
user_id)
values
(2,'2011-01-31','2011-02-07','Place','test','Tom Jones','111-1234','test',0,2)

OR WITH NULL


insert into needs(
id_org, 
date_created,
date_required,
place_required,
description,
contact,
phone,
email, 
remarks, 
cur_id,
estimation,
user_id)
values
(2,'2011-01-31','2011-02-07','Place','test','Tom Jones','111-1234','test',NULL,0,2)