LiveSQL keeps showing me this: ORA-00933: SQL command not properly ended [duplicate]

北城以北 提交于 2021-02-04 21:46:58

问题


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?


回答1:


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;


来源:https://stackoverflow.com/questions/64644823/livesql-keeps-showing-me-this-ora-00933-sql-command-not-properly-ended

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!