1. Vladimir Esipov
  2. Valentina Server
  3. Samstag, Juli 20 2024, 11:37 AM
  4.  Abonnieren via E-Mail
According to WIKI
returns the ID of the current user if he is running on the server, NULL otherwise.

I assumed that the ID returned corresponds to the RecID in the "sysuser" master.vdb table, and is a constant for the connecting user, i.e.

SELECT RecID, fld_name FROM sysuser WHERE fld_name = 'EMB';
=> 1, EMB

and envisioned using it as a record owner identifier to organize something like a row policy

CREATE TABLE "test"(
...
"USER_CREATE" USHORT DEFAULT METHOD( 'ifnull( current_user_id(), 0 )' ) NOT NULL,
"DATE_CREATE" DATE DEFAULT METHOD( 'current_date()' ) NOT NULL );

But the value returned by the function changes randomly from session to session for the same user.

SELECT current_user_id(), current_user_name();
=> 968, EMB
SELECT current_user_id(), current_user_name();
=> 940, EMB
SELECT current_user_id(), current_user_name();
=> 1004, EMB

It is not clear what the meaning of this function is and how it is supposed to be used?
Kommentar
There are no comments made yet.
Vladimir Esipov Akzeptierte Antwort
Question is removed.
The value returned is Connection_ClientID.
But the function name Current_User_ID() is misleading
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories