oracle “引用的字符串未正确终止” sqlplus

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25881418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:30:56  来源:igfitidea点击:

"quoted string not properly terminated" sqlplus

sqloracleoracle10gsqlplus

提问by user3315642

Getting an error when I try to insert values using the following statement

当我尝试使用以下语句插入值时出错

INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
VALUES ('11','19', TO_DATE('01-JAN-2001','DD-MON-YYYY'));

ERROR:
ORA-01756: quoted string not properly terminated

错误:
ORA-01756:带引号的字符串未正确终止

回答by Gordon Linoff

Your question has "smart" quotes in the SQL instead of basic single quotes. Try this:

您的问题在 SQL 中有“智能”引号,而不是基本的单引号。尝试这个:

INSERT INTO PRODUCT(PRODUCT_NUM, ITEM_NUM, DATE)
    VALUES ('11', '19', DATE '2001-01-01')

(I prefer the datekeyword for specifying date constants in Oracle.)

(我更喜欢date在 Oracle 中指定日期常量的关键字。)

回答by ravi chaudhary

INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
VALUES ('11','19', TO_DATE('01-JAN-2001','DD-MON-YYYY'));

use this code as you used wrong quote type

使用此代码,因为您使用了错误的报价类型

回答by paxdiablo

It's almost certainly because you're using the wrong quote types, something that often happens when you cut'n'paste text from a word processor.

这几乎可以肯定是因为您使用了错误的引用类型,当您从文字处理器中剪切和粘贴文本时经常会发生这种情况。

Your example has "angled" quotes rather than the correct 'variant, meaning that either that's the actualproblem, or that you've transcribed it incorrectly which leads me to think you're not matching quotes correctly.

您的示例有“有角度的”引号而不是正确的'变体,这意味着要么这是实际问题,要么是您错误地转录了它,这使我认为您没有正确匹配引号。

This is what you shouldhave:

这是你应该拥有的:

INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
    VALUES ('11','19', TO_DATE('01-JAN-2001','DD-MON-YYYY'));

回答by Peter Pei Guo

use a normal quote, your quote seems to be odd.

使用普通报价,您的报价似乎很奇怪。