Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get instance name in PL/SQL

259294Feb 24 2004 — edited Mar 1 2004
In an SQL window (in PL/SQL Developer) I can issue

select instance_name
from v$instance;

But I can't do the same in PL/SQL - I always get 'table or view does not exist' - I'm assuming this is a limitation on accessing the v$ tables from PL/SQL. Is there any other way to get the instance name for the service the code is currently running on - I want to prevent certain code from running on the development server but still run on the production environmental and one is a copy of the other, so the database name is the same.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2004
Added on Feb 24 2004
10 comments
2,103 views