As part of a GAPTEQ application, a logon script that can execute SQL statements and database procedures is processed each time a user logs in.
In this article you will read the following content:
Available system parameters for SQL statement
Note! The GAPTEQ server provides session variables that are used in the SQL statements to, for example:
- create a mapping between GAPTEQ users and information from the database (e.g. employees),
- set user group membership based on database queries (custom role groups)
- execute service scripts/statements
1. Available system parameters for SQL statement
The following system parameters can be used in the SQL statements:
@login (login string of the logged-in user)
@user_id (ID of the logged-in user)
@user_guid (GUID of the logged-in user)
@fullname (name of the user)
@email (e-mail of the user)
@group_names (comma-separated string with the user groups of the logged-in user)
Note! The usable/provided system parameters are listed in the Database Connections and “Parameters”.
2. Generate SQL statement
Tip! Clicking on “Skeleton” in the menu inserts a script skeleton into the editor, which shows the necessary syntax for the respective use case.
- In the “Statement” tab, you can describe session variables with values from database queries. A session variable must be created in advance in order to be able to describe it here (see Setting session variables).
- Variables that have already been defined can be selected in the “Output Parameters” menu.
Note! Your custom role groups are displayed under “Output parameters” if you have created them in the repository configurations. The group membership is finally defined here. The value “true” or “false” is expected.
- User / Group / User/Group mapping