majordan95
majordan95

Reputation: 3

Why am I getting 'missing comma'?

I am completely new to SQL, and for a project for my intro level class.

I am getting a "missing comma" error for all of my INSERT statements when my numbers are in single quotes, and a "missing expression" error when they are not in quotes. I can not figure out where I am going wrong. Below is just one of my tables and an INSERT statement for that table, but this issue extends to all of my INSERT statements.

CREATE TABLE Cast(
Cast_ID NUMBER(7) NOT NULL PRIMARY KEY,
Cast_Member_Name VARCHAR2(64),
Oscars NUMBER(2)
);
COMMIT;


INSERT INTO Cast VALUES (17,’Tom Cruise’,0)

Below is the error I receive when entering the above INSERT:

INSERT INTO Cast VALUES (17,.Tom Cruise.,0);
INSERT INTO Cast VALUES (17,.Tom Cruise.,0)

ERROR at line 1:
ORA-00936: missing expression

Upvotes: 0

Views: 242

Answers (2)

user9069047
user9069047

Reputation: 11

You miss quotes in Tom cruise. Put it query will cruise. INSERT INTO Cast VALUES (17,'Tom Cruise',0)

Upvotes: 1

It looks like you created your SQL in a word processing program. These programs tend to use odd characters instead of "proper" apostrophes and double quote characters. The characters surrounding your string literals are not apostrophes; you'll need to fix them, as shown below:

INSERT INTO Cast VALUES (17,'Tom Cruise',0)

Best of luck.

Upvotes: 6

Related Questions