0

我正在尝试使用以下方法向 Products 表中添加一个新行:

INSERT INTO Products_mgs( product_id,category_id,product_code,product_name,
description,list_price,discount_percent,date_added)
VALUES ( 11, 4,'YDP162R','Yamaha Arius YDP162R Traditional Console Style Digital Piano',
'The best keyboard on the market. Offers excellent sound rendering
 that truly separates it from the rest of the pack.',1599.99,10,'2020-10-25'()));

但我不断收到此错误消息:

命令行错误:23 列:77 错误报告 - SQL 错误:ORA-00917:缺少逗号 00917。00000 -“缺少逗号” *原因:
*操作:

4

1 回答 1

0

语句末尾有多余的括号,没有任何意义。我还建议对列使用显式文字日期,date_added而不是依赖隐式转换(当然,假设该列是date数据类型)。

所以:

INSERT INTO Products_mgs (
    product_id, 
    category_id, 
    product_code, 
    product_name, 
    description, 
    list_price, 
    discount_percent, 
    date_added
) VALUES (
    11, 
    4, 
    'YDP162R', 
    'Yamaha Arius YDP162R Traditional Console Style Digital Piano',
    'The best keyboard on the market. Offers excellent sound rendering that truly separates it from the rest of the pack.',
    1599.99,
    10,
    DATE '2020-10-25'   --> literal date
);  -- trailing parentheses removed
于 2020-10-25T23:19:00.090 回答