BJCooperIT
Programmer
I have a function in a package that returns the name of the database to which a session is connected by returning GLOBAL_NAME. This has worked well for the past three years. When a testing script is run, the database, date, time and description are displayed:
The database names HSDEV, HSSTAGE, HSPROD have always reflected the database in which the test was run.
We have a new 10g database and we connect to HSDEV.HP. My problem is that the name of this database is returned as HSDEV, not HSDEV.HP:
The function no longer properly identified where the test was run. So I have modified the function to append the version number (extracted from the BANNER column in SYS.V_$VERSION) which helped:
But, the proper way would be to display the database name to which I connect (HSDEV.HP). Any help you can offer is much appreciated.
[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~ George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Code:
HSDEV 04/09/2009 03:41:28pm Test INTERNET_STATUS
We have a new 10g database and we connect to HSDEV.HP. My problem is that the name of this database is returned as HSDEV, not HSDEV.HP:
Code:
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connected as devbjc
SQL> select global_name from global_name;
GLOBAL_NAME
--------------------
HSDEV.WORLD
SQL> select ora_database_name from dual;
ORA_DATABASE_NAME
--------------------
HSDEV.WORLD
SQL> select sys_context('userenv','db_name') from dual;
SYS_CONTEXT('USERENV','DB_NAME
-------------------------------
hsdev
SQL>
Code:
HSDEV 10.2 04/09/2009 03:45:16pm Test INTERNET_STATUS
[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~ George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)