ORA-00933:SQL命令在插入命令中未正确结束 [英] ORA-00933: SQL command not properly ended in insert command

查看:144
本文介绍了ORA-00933:SQL命令在插入命令中未正确结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多具有相同标题的问题,但我在其中找不到答案.

The are many questions with this same title but I can't find an answer among those.

我在做什么错了?

CREATE TABLE J
    (A integer)
;

INSERT INTO J (A)
VALUES
    (1),
    (2),
    (3),
    (4),
    (5),
    (6),
    (7),
    (8),
    (9),
    (10)
;

create起作用.问题只是插入.我在SQL Fiddle中尝试过.

The create alone works. The problem is just the insert. I tried in SQL Fiddle.

推荐答案

您可以通过多种方式进行操作(请参见带有演示的SQL小提琴):

You can do it several ways (See SQL Fiddle with Demo):

INSERT ALL 
    INTO J (A) VALUES (1)
    INTO J (A) VALUES (2)
    INTO J (A) VALUES (3)
    INTO J (A) VALUES (4)
    INTO J (A) VALUES (5)
    INTO J (A) VALUES (6)
    INTO J (A) VALUES (7)
    INTO J (A) VALUES (8)
SELECT * FROM dual
;

或者(请参见带演示的SQL小提琴):

INSERT INTO J (A)
select  (1) from dual union all
select  (2) from dual union all
select  (3) from dual union all
select  (4) from dual union all
select  (5) from dual union all
select  (6) from dual union all
select  (7) from dual union all
select  (8) from dual union all
select  (9) from dual union all
select  (10) from dual

甚至每个都有单独的INSERT语句:

Or even separate INSERT statements for each one:

INSERT INTO J (A) VALUES (1);
INSERT INTO J (A) VALUES (2);
INSERT INTO J (A) VALUES (3);
INSERT INTO J (A) VALUES (4);
INSERT INTO J (A) VALUES (5);
INSERT INTO J (A) VALUES (6);

这篇关于ORA-00933:SQL命令在插入命令中未正确结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆