2015-01-06 36 views
-2

什麼原因導致此錯誤?INSERT INTO供應商casue架構創建失敗:ORA-00922:缺失或無效選項

架構創建失敗: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

+4

你還沒有結束你的陳述;你需要這樣做。使用分號(';')(或者更多地指出您實際使用的代碼,並在您的語句結尾和'//'之間移除新行) – Ben

+0

加入此INSERT代碼 – meno

+0

的WND給我請糾正SQL小提琴 – meno

回答

1

而且,你的INSERT語句在甲骨文可能會失敗(雖然這不是你爲什麼越來越ORA-00922的原因)

贊ge it to:

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

@MaheswaranRavisankar,很好的接收! – silentsurfer