INSERT INTO供应商casue架构创建失败:ORA-00922:缺少或无效选项

时间:2015-01-06 13:04:34

标签: sql oracle

  

导致此错误的原因是什么?

     

架构创建失败:ORA-00922:缺少或无效选项

.........................

CREATE TABLE suppliers 
    (
         sid int, 
         sname varchar(20), 
         address varchar(30)
    )  

    CREATE TABLE product 
    (
         pid int, 
         pname varchar(20), 
         color varchar(30)
    )

    CREATE TABLE catalog 
    (
         sid int, 
         pid int, 
         cost int
    )  

    INSERT INTO suppliers
      (sid, sname,address)
    VALUES
      (1, "name1","address1"),
      (2, "name2","address2");

SQL Fiddle

1 个答案:

答案 0 :(得分:1)

此外,您的INSERT语句可能会在Oracle中失败(尽管这不是您获得ORA-00922的原因)

将其更改为:

INSERT ALL
  INTO suppliers(sid, sname,address) VALUES (1, 'name1','address1')
  INTO suppliers(sid, sname,address) VALUES (2, 'name2','address2')
SELECT * FROM dual;