Oracle pl-sql 转义字符(用于“'")

2021-12-30 00:00:00 escaping oracle11g oracle

当我尝试在 oracle 中执行 INSERT 语句时,出现 SQL 错误:ORA-00917:缺少逗号 错误,因为有一个值为 Alex 的Tea Factory 在我的 INSERT 语句中.

When I am trying to execute INSERT statement in oracle, I got SQL Error: ORA-00917: missing comma error because there is a value as Alex's Tea Factory in my INSERT statement.

我怎样才能转义 ' ?

推荐答案

要转义,请将引号加倍:

To escape it, double the quotes:

INSERT INTO TABLE_A VALUES ( 'Alex''s Tea Factory' );

相关文章