Edwin
Edwin

Reputation: 11

Oracle - ORA-00917: missing comma

INSERT INTO contact(id, org_name, street_address1, street_address2,  
   city, state, postal_code, country_code, last_name, first_name,
   person_title, phone_country_code, phone_area-code, phone_number, email, created_time)
VALUES(20, 'cognizant', 'chennai', 'ckc',
   'tamilnadu', '092345', '0934', 'Edwin', 'Michael',
   'MR', 09, 10, '0924242', '[email protected]', 09824);

When I am trying to execute the code above, I'm getting the error below:

ERROR at line 1: ORA-00917: missing comma

Upvotes: -2

Views: 335

Answers (3)

Barbaros Özhan
Barbaros Özhan

Reputation: 65228

  • i think the column name phone_area-code is phone_area_code(ahyphen can not be used for a column name)
  • the last value should be quoted as '09824' which's non-integer as having a leading zero
  • the values list has 15 items, while column names list has 16.

Upvotes: 3

shaqirzul
shaqirzul

Reputation: 1

Your column count 16 but your data that you inserted only 15. You missing one value there, just put single quote '', for the missing value or the value that you dont want to input anything.

Upvotes: 0

Racil Hilan
Racil Hilan

Reputation: 25351

You are missing the value for the state. If you don't have a value for it, you must pass it as empty string '' or NULL:

INSERT INTO contact(id, org_name, street_address1, street_address2,  
   city, state, postal_code, country_code, last_name, first_name,
   person_title, phone_country_code, phone_area-code, phone_number, email, created_time)
VALUES(20, 'cognizant', 'chennai', 'ckc',
   'tamilnadu', '', '092345', '0934', 'Edwin', 'Michael',
   'MR', 09, 10, '0924242', '[email protected]', 09824);

Upvotes: 1

Related Questions