Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Don.

Asked: July 22, 2016 - 6:36 pm UTC

Last updated: July 24, 2016 - 9:01 pm UTC

Version: 11g

Viewed 1000+ times

You Asked

Which (if either) is preferable for determining the current database name: ORA_DATABASE_NAME or sys_context('USERENV', 'DB_NAME') ?

Thanx, D

and Connor said...

Some other builtins (I havent explicitly checked ORA_DATABASE_NAME) implicitly invoke a 'select from dual' to derive the value, which is why I'll generally opt for SYS_CONTEXT.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Don Simpson, July 22, 2016 - 7:48 pm UTC

Great, thanx.

Connor McDonald
July 24, 2016 - 9:01 pm UTC

Glad we could help