You create an SQL session with the database instance for the specified database user.
If you do not specify a user, the system uses the data of the first DBM user. For this reason, only those database statements for which the first DBM user is authorized can be executed in this case.
When executing DBM commands in most cases that require an SQL session, the session is opened and closed implicitly. In this case, you do not have to open an SQL session explicitly.
We only recommend using a DBM command for opening an SQL session if you are dealing with SQL statements that can only be executed by particular database users, or for performance reasons, if you want to transfer a large number of SQL statements.
In this case, open the SQL session and specify the required database user, execute the required SQL statements (see: sql_execute) and then close the SQL session (see: sql_release).
· You have the server authorization DBInfoRead or AccessSQL.
· You are working in the script or session mode.
sql_connect <user_identification>
<user_identification> :: = <user_spec> | <user_type>
<user_spec> :: = <database_user_name>,<database_user_password>
<user_type> :: = user-type=<value>
Options
Option |
Description |
<database_user_name> |
Name of the database user |
<database_user_password> |
Password of the database user |
user-type=<value> |
User type, possible values are: DBM: DBM operator DBA: database system administrator SAP: database user of the SAP application |
OK
In the event of errors, see Reply Format
...
1. Logging on to the Database Manager CLI in session mode as operator OLEG with the password MONDAY, connecting to the database instance DEMODB.
>dbmcli -u OLEG,MONDAY -d DEMODB
dbmcli on DEMODB>
2. Starting an SQL session for database user MONA with password RED:
dbmcli on DEMODB>sql_connect MONA,RED
OK