Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Current_SessionID
Wed, Oct 3 2018 4:51 AMPermanent Link

Adam Brett

Orixa Systems

Sorry I am starting a lot of threads at the moment.

Can anyone explain this to me:

SELECT
ID,
Name,
IF(Current_SessionID = ID THEN 'Yes' ELSE 'No') as "IsItCurrent",
Current_SessionID
FROM Configuration.ServerSessions
WHERE ID = Current_SessionID

Run the above against a remote instance of EDB Server, ideally running a few sessions.

It returns a row (ie the WHERE statement returns true) but the computed field returns "No" ... HUM, scratches head ...

I ask because it is useful for me to identify the current thread in this way in certain circumstances, and the above ought to work!
Wed, Oct 3 2018 8:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

I suspect that its some sort of timing or context problem. What happens if you take the WHERE clause out?

I can't test here because I no longer run a server.

Roy Lambert
Wed, Oct 3 2018 8:39 AMPermanent Link

Greg Hallam

Microcalm Solutions Inc

I ran it on one of my servers that always has lots of connections (2.28b6) and it returned "Yes".  There must be more variables we are not aware of . . . yet
Wed, Oct 3 2018 11:40 AMPermanent Link

Adam Brett

Orixa Systems

gbh100 wrote:

>> it returned "Yes".  

OK, thanks for this, your system is working as I would expect, but mine is not. I am calling the Query from EDB manager and from a Delphi EXE, both definitely accessing EDB via the server.

I will try to figure out what I am doing differently!

If I find out anything useful I'll post about it.
Image