I'm getting an error in SQL command not properly ended

前端 未结 5 624
梦毁少年i
梦毁少年i 2021-01-17 17:36

when I enter this

INSERT INTO works_on
(essn, pno, hours)
values
(\'123456789\', 1, 32.5),
(\'123456789\', 2, 7.5),
(\'666884444\', 3, 40.0),
(\'453453453\',         


        
5条回答
  •  清酒与你
    2021-01-17 17:53

    The VALUES syntax supports inserting only one entries into a database. In the ORACLE FAQs, the following is suggested:

    INSERT ALL
    INTO works_on (essn, pno, hours) VALUES ('123456789', 1, 32.5)
    INTO works_on (essn, pno, hours) VALUES ('123456789', 2, 7.5)
    INTO works_on (essn, pno, hours) VALUES ('666884444', 3, 40.0)
    INTO works_on (essn, pno, hours) VALUES ('453453453', 1, 20.0)
    INTO works_on (essn, pno, hours) VALUES ('453453453', 2, 20.0)
    INTO works_on (essn, pno, hours) VALUES ('333445555', 2, 10.0)
    INTO works_on (essn, pno, hours) VALUES ('333445555', 3, 10.0)
    INTO works_on (essn, pno, hours) VALUES ('333445555', 10, 10.0)
    INTO works_on (essn, pno, hours) VALUES ('333445555', 20, 10.0)
    INTO works_on (essn, pno, hours) VALUES ('999887777', 30, 30.0)
    INTO works_on (essn, pno, hours) VALUES ('999887777', 10, 10.0)
    INTO works_on (essn, pno, hours) VALUES ('987987987', 10, 35.0)
    INTO works_on (essn, pno, hours) VALUES ('987987987', 30, 5.0)
    INTO works_on (essn, pno, hours) VALUES ('987654321', 30, 20.0)
    INTO works_on (essn, pno, hours) VALUES ('987654321', 20, 15.0)
    INTO works_on (essn, pno, hours) VALUES ('888665555', 20, 0)
    SELECT * FROM dual;
    

提交回复
热议问题