Reputation: 1814
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
Reputation: 3362
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
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
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