SQL - ORA-00911 我插入的字符无效
SQL - ORA-00911 Invalid character on my insertions
使用 Oracle Live SQL。无论我做什么,我都会得到 ORA-00911(无效字符)。我的代码哪里出错了?
我尝试过多种方式来更改值,包括更改数据类型。
CREATE TABLE Books
(Title varchar(25) NOT NULL,
Author varchar(25) NOT NULL,
PRIMARY KEY (title)
);
INSERT INTO Books (title, author)
VALUES (‘To Kill a Mockingbird’, ‘Harper Lee’);
INSERT INTO Books (title, author)
VALUES (‘The Great Gatsby’, ‘F. Scott Fitzgerald’);
INSERT INTO Books (title, author)
VALUES (‘Dante’s Inferno’, ‘Dante Alighieri’);
INSERT INTO Books (title, author)
VALUES (‘Harry Potter and the Sorcerer’s Stone’, ‘J.K. Rowling’);
INSERT INTO Books (title, author)
VALUES (‘The Hobbit’, ‘J. R. R. Tolkien’);
首先是将 ‘
更改为 '
其次。该值超出了 Title
列的最大长度,即 25
VALUES (‘Harry Potter and the Sorcerer’s Stone’, ‘J.K. Rowling’); -> #of chars = 37
第三种是通过添加 '
、‘Dante'’s Inferno’
来转义单引号
VALUES (‘Harry Potter and the Sorcerer'’s Stone’, ‘J.K. Rowling’); -> #of chars = 37
使用 Oracle Live SQL。无论我做什么,我都会得到 ORA-00911(无效字符)。我的代码哪里出错了?
我尝试过多种方式来更改值,包括更改数据类型。
CREATE TABLE Books
(Title varchar(25) NOT NULL,
Author varchar(25) NOT NULL,
PRIMARY KEY (title)
);
INSERT INTO Books (title, author)
VALUES (‘To Kill a Mockingbird’, ‘Harper Lee’);
INSERT INTO Books (title, author)
VALUES (‘The Great Gatsby’, ‘F. Scott Fitzgerald’);
INSERT INTO Books (title, author)
VALUES (‘Dante’s Inferno’, ‘Dante Alighieri’);
INSERT INTO Books (title, author)
VALUES (‘Harry Potter and the Sorcerer’s Stone’, ‘J.K. Rowling’);
INSERT INTO Books (title, author)
VALUES (‘The Hobbit’, ‘J. R. R. Tolkien’);
首先是将 ‘
更改为 '
其次。该值超出了 Title
列的最大长度,即 25
VALUES (‘Harry Potter and the Sorcerer’s Stone’, ‘J.K. Rowling’); -> #of chars = 37
第三种是通过添加 '
、‘Dante'’s Inferno’
VALUES (‘Harry Potter and the Sorcerer'’s Stone’, ‘J.K. Rowling’); -> #of chars = 37