做一些 Oracle DBA 作业,我看过几篇关于 00917 错误的帖子,但我只是在做一个简单的 INSERT。我似乎看不出我在哪里缺少逗号或括号。有什么帮助吗?
INSERT INTO copy_f_orders
(ORDER_NUMBER, TO_DATE(ORDER_DATE, 'mm-dd-RRRR'), ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, '09-23-2004', 145.98, 225, 12);
做一些 Oracle DBA 作业,我看过几篇关于 00917 错误的帖子,但我只是在做一个简单的 INSERT。我似乎看不出我在哪里缺少逗号或括号。有什么帮助吗?
INSERT INTO copy_f_orders
(ORDER_NUMBER, TO_DATE(ORDER_DATE, 'mm-dd-RRRR'), ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, '09-23-2004', 145.98, 225, 12);
不要在列列表中使用函数调用:
INSERT INTO copy_f_orders(ORDER_NUMBER, ORDER_DATE, ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, '09-23-2004', 145.98, 225, 12);
如果您需要在值中调用它:
INSERT INTO copy_f_orders(ORDER_NUMBER, ORDER_DATE, ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, TO_DATE('09-23-2004', 'mm-dd-RRRR'), 145.98, 225, 12);
INSERT INTO copy_f_orders
(ORDER_NUMBER, TO_DATE(ORDER_DATE, 'mm-dd-RRRR'), ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, '09-23-2004', 145.98, 225, 12);
它应该是
INSERT INTO copy_f_orders
(ORDER_NUMBER, ORDER_DATE, ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, TO_DATE('09-23-2004', 'mm-dd-RRRR'), 145.98, 225, 12);
在列上使用 TO_DATE 函数没有意义,希望它有意义。
("INSERT INTO copy_f_orders
(ORDER_NUMBER, TO_DATE(ORDER_DATE, 'mm-dd-RRRR'), ORDER_TOTAL, CUST_ID, STAFF_ID)
VALUES (5691, '09-23-2004', 145.98, 225, 12)");