[Solved] Find session_user in HSQL2.5

Creating tables and queries
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved] Find session_user in HSQL2.5

Post by gkick »

Hi all,

In a multi user setup I can find out who is registered as a system user by running SELECT * FROM INFORMATION_SCHEMA.SYSTEM_USERS, but I am at a complete loss as to how to find the name of the CURRENT_USER or SESSION_USER which apparently is the same? The HSQL manual only waffles about some temporary table ? There must be a way to list all sessions and associated users.
Anyone familiar with this, thanks for your thoughts.
Last edited by robleyd on Tue Feb 04, 2020 8:06 am, edited 2 times in total.
Reason: Add green tick
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Find session_user in HSQL2.5

Post by Sliderule »

gkick wrote:There must be a way to list all sessions and associated users.

Code: Select all

SELECT 
   INFORMATION_SCHEMA.SYSTEM_SESSIONS.* 
FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS
and, choose the columns you wish to see / use.

For example:

Code: Select all

SELECT 
   INFORMATION_SCHEMA.SYSTEM_SESSIONS.SESSION_ID, 
   INFORMATION_SCHEMA.SYSTEM_SESSIONS.USER_NAME,
   INFORMATION_SCHEMA.SYSTEM_SESSIONS.CONNECTED 
FROM INFORMATION_SCHEMA.SYSTEM_SESSIONS
HSQL 2.5.0 Documentation wrote:
SYSTEM_SESSIONS


Information on all open sessions in the database (when used by a DBA user), or just the current session. Includes the current transaction state of each session.
I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: [Solved] Find session_user in HSQL2.5

Post by gkick »

Thanks, works like a treat!
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply