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)? The CONNECTION_NAME field of the GET DIAGNOSTICS command will return the name of the CONNECTION_NAME last set. I'm not sure what is reported to the various threads in a multi-threaded application (7.22+) as it is not documented and I have not yet tried to write such a beast. Art S. Kagel kagel@bloomberg.com