Re: current database name
Posted in 2003
Art S. Kagel — — source: Usenet: comp.databases.informix
On Fri, 05 Dec 2003 09:20:10 -0500, John David Adamski wrote:
> We are on IDS 7.31 on a HPUX machine and have 5 databases and I have some SQL
> that runs in dbaccess on most of them regularly. Its just a report and it
> would be nice to know on the report which database this one was generated.
>
> What is the SQL code that will identify the current database I am running on?
select sqc_currdb
from syssqlcurall
where sqc_sessionid = dbinfo('sessionid');
The VIEW syssqlcurall simplifies a complex query on the sysopendb table.
Art S. Kagel