Subject Re: [firebird-support] Re: Set custom value on connection system info
Author livius
Hi,

you store in your persistent table login (user_name) it is presistent information.
You join your persistent table which should contain login name and you join your persistent table with mon$attachment an you know who is currently logged in.

once again sample

CREATE TABLE MY_USERS
(USER_ID INTEGER NOT NULL PRIMARY KEY,
NAME VARCHAR(32) NOT NULL,
AGE INTEGER,
...
LOGIN_NAME VARCHAR(32) NOT NULL
);

sample record
USER_ID=1
NAME=’Karlos’
AGE=52
..
LOGIN_NAME=’SYSDBA’


and you run sql

SELECT * FROM MY_TABLE MT INNER JOIN MON$ATTACHEMNTS A ON A.MON$USER=MT.LOGIN_NAME

regards,
Karol Bieniaszewski


From: marco andreolli drazde@... [firebird-support]
Sent: Saturday, February 10, 2018 9:15 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Re: Set custom value on connection system info



Hi,

I have a table of users, but I wouldn't store in persistent table a volatile information (if it was possible).


The link between a connection id and user id isn't a persistent information (like connections,transaction ecc...)



2018-02-08 6:19 GMT+01:00 liviuslivius liviuslivius@... [firebird-support] <firebird-support@yahoogroups.com>:


Hi,

what do you mean by maintain here? Do you have custom user information table or not? If not then what do you need to store in this context var?

I supposed that you have custom user information table and you need to match your user record with server user to know who is logged into the server.

Regards,
Karol Bieniaszewski




[Non-text portions of this message have been removed]