Subject Re: current_user ID
Author Adam
--- In firebird-support@yahoogroups.com, Maxim Evdokimov
<firebird@...> wrote:
>
> Hello Firebird,
>
> sorry for my english ... if it bad :)

It is fine.

>
> 1. I need to provide in client login to FB 2.0 server with name in
my native
> collation.
> 2. I need to fill one column with some setting, that would be able
> to be displayed as a real name of current user (in my native
collation).
>
> I have table 'workers', that consists of real names etc.
>
> How can connect this table with the table of users of a DB.
>
> - is it possible to get information from security DB? (i write to
> this column current_user and when displaying - get information from
> security table, which contains real names).

Well you can store a mapping in your database between CURRENT_USER and
the workersid. You can't directly connect to the security database,
and IIRC there are other limitations about the charset of the username
and that the name can not be changed without deleting it and creating
a new one.

>
> - is it possible get ID of current user and update
> table 'workers' when user added to security DB (when user added - in
> 'workers' created new row with user id and his name)

I don't believe there is any such trigger, but if your application
calls the services API to add a user, you could call a stored
procedure in your main database at that point in time to do the
necessary linking between Firebird user and workersid.

Adam