微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SQL错误:ORA-00917:缺少逗号0091700000-“缺少逗号” *原因:*操作:

如何解决SQL错误:ORA-00917:缺少逗号0091700000-“缺少逗号” *原因:*操作:

我正在尝试向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-“缺少逗号” *原因:
*动作:

解决方法

语句末尾有多余的括号是没有意义的。我还建议对列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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。