Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select a current "database_name" ? 2

Status
Not open for further replies.

Rosti

Programmer
Mar 5, 2002
46
US
Hi.
Is it any way to write this kind of a statement:
SELECT "current_database_name"
FROM ....


Thanks in advance.
Rostik
[rockband]
 
Rosti:

Here's a trick I learned from Jonathan Leffler, the heavy-weight of all Informix heavy weights:

SELECT ODB_DBName
FROM SysMaster:"informix".SysOpenDB
WHERE ODB_SessionID = DBINFO('sessionid')
AND ODB_IsCurrent = 'Y';

SysOpenDb isn't a table, but a view into the SysMaster database.

Regards,


Ed
 
Thank you very much for the responces.
Ed, your SELECT work just wonderfull !!!!!


Thanks again for help.

Rostik
[rockband]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top