ORA-01756: quoted string not properly terminated when I try to execute my code(ORA-01756: 当我尝试执行我的代码时,引用的字符串没有正确终止)
本文介绍了ORA-01756: 当我尝试执行我的代码时,引用的字符串没有正确终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每次尝试在 oracle 中运行此代码时,我都会收到以下消息.代码如下:
I keep getting the following message every time I try to run this code in oracle. The code is as follows:
DROP TABLE movie;
CREATE TABLE movie (movie_id NUMBER(5) PRIMARY KEY,
title VARCHAR2(45) NOT NULL,
description VARCHAR2(250) NOT NULL,
released_by NUMBER(3) NOT NULL,
released_on DATE NOT NULL);
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES ('1', 'Edge of Tomorrow', 'Lieutenant Colonel Bill Cage is a skilled tactician who has honed his abilities through his experiences as a soldier. However, there is still much he can learn, and soon he is going to get his chance.', '1', '07-OCT-2014');
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('2', 'Captain America: Winter Soldier', 'Steve Rogers is finding it difficult to adjust to living life in the contemporary world. He is working for S.H.I.E.L.D. and begins to suspect a mystery is brewing there.', '2', '09-SEP-2014');
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('3', 'Fed Up', 'America’s problem with obesity is caused by our inactivity. Or is it? Katie Couric and Stephanie Soechtig tempt us to restructure our beliefs about the American diet, through this thought-provoking expose.', '3', '09-SEP-2014');
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('4', 'Godzilla', 'The legendary tale of Godzilla comes roaring back to life. This time, it's the modern era, and Godzilla is a giant lizard who has been made fearsome through the interference of radiation.', '1', '16-SEP-2014');
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('5', 'Neighbors', 'New parents Mac and Kelly settle into domesticity in a quiet neighborhood. The tranquility they have been afforded ceases to exist when a fraternity moves into the house next door.', '2', '14-SEP-2014');
COMMIT;
以下是我尝试在 Oracle 中执行时得到的结果:
Below is what I get when I try to execute it in Oracle:
Table dropped.
Table created.
1 row created.
1 row created.
1 row created.
ERROR:
ORA-01756: quoted string not properly terminated
1 row created.
Commit complete.
SQL>
任何帮助将不胜感激.谢谢.
Any help would be greatly appreciated. Thank you.
推荐答案
转义单引号:
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('4', 'Godzilla', 'The legendary tale of Godzilla comes roaring back to life. This time, it''s the modern era, and Godzilla is a giant lizard who has been made fearsome through the interference of radiation.', '1', '16-SEP-2014');
注意 it's
而不是 it's
.
这篇关于ORA-01756: 当我尝试执行我的代码时,引用的字符串没有正确终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:ORA-01756: 当我尝试执行我的代码时,引用的字符串没有正确终止
基础教程推荐
猜你喜欢
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server 2016更改对象所有者 2022-01-01