Sql error: Unknown column in field list insert

I am trying to insert a record into a table using Java and it gives me the error "Unknown column XX in field list".

For example: I created a table using this line:

CREATE  TABLE `dbcs`.`born in` (`person` VARCHAR(100) ,`year` INT ,`prob` FLOAT);

      

the table was created successfully.

when i try to insert something into the table it shows me an error. for example the command:

INSERT INTO `dbcs`.`born in` VALUES (`Alanis Morissette`,1974,1.0)

      

generates an error:

Unknown column "Alanis Morissette" in "field list"

+6


source to share


2 answers


Strings must be enclosed in quotes. You are using the wrong ticks.



INSERT INTO `dbcs`.`born in` VALUES ('Alanis Morissette',1974,1.0)

      

+12


source


use



INSERT INTO dbcs.born in VALUES ('Alanis Morissette',1974,1.0)

      

+1


source







All Articles