Entering content frame

 Opening an SQL Session: -uSQL 

Use

Certain DBM commands require an SQL session before they can be executed.

If, when you log on to the Database Manager CLI using the DBM options –d (name of the database instance) and –u (DBM operator), you also specify the DBM option –uSQL, the DBM command for opening an SQL session is executed implicitly.

You use the DBM option -uSQL to transfer the user data for the required database user. The SQL session is opened with this user data for the specified database instance.

When you end the Database Manager CLI, the service session is also ended.

Note the different meanings of the command with uppercase and lowercase specification.
-
uSQL:Specification of the database user identified with the user name and password
-USQL:Logon with a user key stored in the XUSER file for a database user

See also: XUSER

If no operator is specified with -uSQL, the Database Manager CLI uses the data of the first DBM operator for the database instance specified. Opening an SQL session with the first DBM operator is successful only if the DBM operator logged on to the Database Manager CLI has the server authorization required for executing the DBM command for opening an SQL session.

The database user specified with the user name and password or with an XUSER key must have been created for the database instance specified under the DBM option -d, otherwise the command fails.

When the SQL session is opened, any database name stored under a specified XUSER key is ignored.

Syntax

Log on using name and password for a database user:

-uSQL [<database_user>,<database_user_password>]

Or log on with the XUSER key of a database user:
-USQL <user_key>

Example for -uSQL

Call the Database Manager CLI, log on to the database instance HOTELDB as operator DBM with password DBM, display the content of the database table customer for the database user MONA with password RED.

dbmcli -d HOTELDB -u DBM,DBM -uSQL MONA,RED sql_execute SELECT * FROM customer

OK
<content_of_table_customer>

Example for -USQL

Call the Database Manager CLI, log on to the database instance HOTELDB as operator DBM with password DBM, display the content of the database table customer for the database user under the MOKEY XUSER key.

dbmcli -d HOTELDB -u DBM,DBM -USQL MOKEY sql_execute SELECT * FROM customer

OK
<content_of_table_customer>

 

 

Leaving content frame