oracle pl/sql 美元运算符?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/151190/
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
pl/sql dollar operator?
提问by nerraga
I encountered the following ddl in a pl/sql script this morning:
我今天早上在 pl/sql 脚本中遇到了以下 ddl:
create index genuser.idx$$_0bdd0011 ...
创建索引 genuser.idx$$_0bdd0011 ...
My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special significance in this statement?
我最初的想法是索引名称是由工具生成的……但我也不是 pl/sql 超级明星,所以我很可能是不正确的。双美元符号在这个声明中有什么特殊的意义吗?
采纳答案by Justin Cave
Your initial thought seems to be correct. That would look to be an index name generated by a tool (but not assigned by Oracle because an index name wasn't specified). Dollar signs don't have any particular meaning other than being valid symbols that are rarely used by human developers and so are handy to reduce the risk that a system-generated name conflicts with a human-generated name.
你最初的想法似乎是正确的。这看起来是由工具生成的索引名称(但不是由 Oracle 分配的,因为未指定索引名称)。美元符号除了是人类开发人员很少使用的有效符号之外没有任何特殊含义,因此可以方便地降低系统生成的名称与人类生成的名称冲突的风险。
回答by Eddie Awad
No special meaning or significance.
没有特别的意义或意义。
SQL> create table t (col number)
2 /
Table created.
SQL> create index idx$$_0bdd0011 on t(col)
2 /
Index created.
Note: CREATE INDEX is a DDL statement which is usually executed in a SQL script, not in PL/SQL.
注意:CREATE INDEX 是一个 DDL 语句,通常在 SQL 脚本中执行,而不是在 PL/SQL 中。
回答by David Aldridge
Regardless of where he name came from, it's contrary to Oracle's documented advice: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements008.htm#SQLRF00223
不管他的名字来自哪里,这都与 Oracle 的文档建议相反:http: //download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements008.htm#SQLRF00223
Oracle strongly discourages you from using $ and # in nonquoted identifiers
Oracle 强烈建议您不要在不带引号的标识符中使用 $ 和 #