views:

647

answers:

3

I encountered the following ddl in a pl/sql script this morning:

create index 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?

+2  A: 

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.

EddieAwad
+2  A: 

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.

Justin Cave
I think the 0bdd0011 takes care of that.
+2  A: 

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 strongly discourages you from using $ and # in nonquoted identifiers

David Aldridge
What does that even mean? "Strongly discourage"? Oooo you better not do it, or, or... or... I'm gonna get REALLY mad. WTF
Yeah, it's not really tantamount to "$ and # are unsupported in nonquoted delimiters". Personally I always had a soft spot for naming primary key columns of tables as MY_TABLE#. Now, I feel "discouraged" from doing so :(
David Aldridge