obtaining session id
Posted in 1998
Does anyone know of a way for a stored procedure to obtain it's own session id (sysmaster.syssessions.sid)? In other words, is there some way for a stored procedure to be able to look at sysmaster.syssessions and know which row describes itself? All connections to the database through our app use the same user name, so 'username' or 'uid' will not work. Basically, we write an application that needs to: 1. Connect to the database. 2. Record the session id for that connection. 3. Validate through a later connection wether or not the earlier connection is still active. MS SQL Server and Oracle both provide means by which a connection can obtain it's own session id, a global system variable and a system view respectively. I have called Informix tech support and at first look they do not know how this could be done. Thank you, Nicole Guffey DBA J. Driscoll & Associates nguffey@jdriscoll.com