Tobias Funke
Tobias Funke

Reputation: 1814

Inserting information into a table on SQL

I am trying to insert new information into an already existing table. This is my code which is not working:

INSERT INTO customer (cNo, cName, street, city, county, discount)
VALUES (10, Tom, Long Street, Short city, Wide County, 2);

Where am I going wwrong?

Upvotes: 0

Views: 56

Answers (3)

You must separate values with a comma, and enclose text fields in quotation marks (' '). check this

Try this code:

INSERT INTO customer (cNo, cName, street, city, county, discount) 
VALUES (10, 'Tom', 'Long Street', 'Short city', 'Wide County', 2);

Upvotes: 2

Sal00m
Sal00m

Reputation: 2916

You must use quotes for string values:

INSERT INTO customer (cNo, cName, street, city, county, discount)
VALUES (10, 'Tom', 'Long Street', 'Short city', 'Wide County', 2);

Upvotes: 4

Linger
Linger

Reputation: 15068

You are not specifying your strings properly it should be:

INSERT INTO customer (cNo, cName, street, city, county, discount) 
VALUES (10, 'Tom', 'Long Street', 'Short city', 'Wide County', 2);

Upvotes: 3

Related Questions