我可能在这里犯了一个新手错误,但是当我尝试插入新数据时,我得到了ora-00928错误代码。看一看:
INSERT ALL
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'GLOCK', '1982', 'PISTOLS', 'AUSTRIA')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'BERETTA', '1526', 'PISTOLS', 'ITALY')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'SMITH AND WESSON', '1856', 'PISTOLS', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'MOSSBERG', '1919', 'SHOTGUNS', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'BENELLI', '1967', 'SHOTGUNS', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'BROWNING', '1878', 'SHOTGUNS', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'WINCHESTER', '1866', 'RIFLES', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'BUSHMASTER', '1973', 'RIFLES', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'REMINGTON', '1816', 'RIFLES', 'UNITED STATES')
INTO MANUFACTURER ( MANUFACTURER_ID, NAME, YEAR_FOUNDED, SPECIALTY, ORIGIN)
VALUES (MANUFACTURER_ID_SEQ.NEXTVAL, 'KLASHNIKOV', '1807', 'RIFLES', 'UNITED STATES');
我做错什么了?任何见解都会有帮助。
3条答案
按热度按时间vfwfrxfs1#
在陈述的结尾加上:
INSERT ALL
INTO t1 (col1, col2, ...) VALUES (val1, val2, ...)
INTO t1 (col1, col2, ...) VALUES (val1, val2, ...)
INTO t1 (col1, col2, ...) VALUES (val1, val2, ...)
SELECT * FROM dual
e0uiprwp2#
完整脚本(';'应在双后)
t1rydlwq3#
Year_founded
列必须是int类型的列,因此不要使用''
在int type列中插入值时。添加
SELECT * FROM DUAL
最后。下面是一个使用您的查询的示例: