Re: Retrieve current connection
Posted in 1997
Johannes Plassmann wrote:
>
> Hi there,
> I have a question concerning connections (CONNECT to, DISCONNECT from
> commands). During program execution we set a connection to a database
> server through (e.g. CONNECT to '@soc20_1'). In other parts of the
> program (running in a shared library, used by several instances of
> different programs), we would like to know which connection is currently
> in use. So my question: Is there a possibility to retrieve the current
> active connection (via some kind of GET CONNECTION command)?
You don't mention the version, and I'm not sure which version it
came out in, but you can select DBSERVERNAME like so:
SELECT DBSERVERNAME
FROM systables
WHERE tabid = 1
or with any other SELECT, if you just need the database server name.
Hope that helps,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //|
| +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+