Michael Michael - 4 months ago 11
SQL Question

SQL Developer help missing comma error

I am creating a table in Oracle.

On doing the following insert I keep getting missing comma error but no comma is missing from what I can see

INSERT INTO driver
(employee_no, first_name, last_name, ni_no, telephone, hazardous_goods)
VALUES
(122085,'Norris','Vasyutichev','EE 91 44 59 G',01809 7872896,07610 2265827,'Y');


even with

INSERT INTO driver
(first_name, last_name, ni_no, hazardous_goods)
VALUES
('Norris','Vasyutichev','EE914459G','Y');


I get the missing comma error


Error at Command Line:27 Column:86

Error report:

SQL Error: ORA-00917: missing comma

00917. 00000 - "missing comma"


Answer

You missed actually by putting space between the number "01809 7872896" and it should be "018097872896" without space and this one "07610 2265827" to "076102265827". If it's matched with the column list. If not, change it to string by putting single quotes around them. Like '01809 7872896,07610 2265827' and I think you should do the second one as it seems to be phone numbers separated by a comma as a string.

Cheers

Comments