0
INSERT INTO Countries (Country, Capital, Cities)
VALUES ('Philippines','Manila',122),
    ('USA','Washington',19495),
    ('Brazil','Brasilia',1642),
    ('Latvia','Riga',9),
    ('Egypt','Cairo',124)
;

I've tried removing the (Country, Capital, Cities), sticking it back on, putting them all in the same line, putting bigger indents, spacing them out. nothing. It keeps throwing me this error: ORA-00933: SQL command not properly ended.. What's wrong with my code?

Ina Hbjn
  • 7
  • 1

1 Answers1

0

Oracle doesn't support inserting multiple rows using a single values. I find that the simplest method is insert . . . select:

INSERT INTO Countries (Country, Capital, Cities)
    SELECT 'Philippines', 'Manila', 122 FROM DUAL UNION ALL
    SELECT 'USA', 'Washington', 19495 FROM DUAL UNION ALL
    SELECT 'Brazil', 'Brasilia', 1642 FROM DUAL UNION ALL
    SELECT 'Latvia', 'Riga', 9 FROM DUAL UNION ALL
    SELECT 'Egypt', 'Cairo', 124 FROM DUAL;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786