system
September 5, 2009, 10:34am
1
HI
I would like to print the connection name for an Oracle connexion (I mean the SID used)
the database_name function does not work and display nothing
It’s work with an alias but I’m not using alias
I have not found that in the documentation
thanks in advance
Mickael PARIS
denier (BOB member since 2009-06-11)
system
September 5, 2009, 9:54pm
2
you can write a custom function and use DI sql() function to get this information from DB
you can Query the V$SESSION or V$INSTANCE if the user has permission or could try other Oracle Queries/function to get the info
SELECT * FROM GLOBAL_NAME;
or
select sys_context(‘userenv’,‘db_name’) from dual;
you can use this in DI sql() function
$DB_SID=sql(‘ORA_DS’, ‘select sys_context(‘userenv’,‘db_name’) from dual’);
manoj_d (BOB member since 2009-01-02)
system
September 7, 2009, 12:13pm
3
the exact response that I needed… thanks a lot
Mickael
denier (BOB member since 2009-06-11)
system
November 18, 2009, 9:38pm
4
Another easier method would be
print(datastore_field_value(‘your-datastore-name’,‘oracle_host_string’));
This would remove the dependency on oracle permission and so on…
superkents (BOB member since 2009-03-02)