我可以在Oracle标题中转义双引号吗? [英] Can I escape double quotes in column titles with Oracle?

查看:841
本文介绍了我可以在Oracle标题中转义双引号吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用双引号创建表以转义实际的双引号在Oracle的SQL语法中似乎不起作用:

Creating a table with a double quote to escape the real double quote doesn't seem to work in Oracle's SQL syntax:

CREATE TABLE "MyTable" (
"Col""umn 1" varchar(168)
);

上述操作失败。有没有办法逃避双引号做'Col'umn 1'?

The above fails. Is there any way to escape the double quote to make 'Col"umn 1'?

推荐答案

b根据文档


非引号标识符只能包含来自
的字母数字字符数据库字符集和下划线(_),美元符号($),
和英镑符号)。数据库链接也可以包含句点(。)和
atsigns(@)。Oracle强烈建议你不要在
非引用的标识符中使用$和#。

Nonquoted identifiers can contain only alphanumeric characters from your database character set and the underscore (_), dollar sign ($), and pound sign (#). Database links can also contain periods (.) and "at" signs (@). Oracle strongly discourages you from using $ and # in nonquoted identifiers.

引号标识符可以包含任何字符和标点符号
以及空格。但是,引号和非引号标识符
都不能包含双引号或空字符(\ 0)。

Quoted identifiers can contain any characters and punctuations marks as well as spaces. However, neither quoted nor nonquoted identifiers can contain double quotation marks or the null character (\0).

这篇关于我可以在Oracle标题中转义双引号吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆