Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pl/sql dollar operator?

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?

like image 961
nerraga Avatar asked Dec 07 '25 04:12

nerraga


2 Answers

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.

like image 152
Eddie Awad Avatar answered Dec 08 '25 17:12

Eddie Awad


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.

like image 45
Justin Cave Avatar answered Dec 08 '25 17:12

Justin Cave



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!