Entering content frame

Syntax documentation -uSQL: Opening an SQL Session Locate the document in the library structure

Use

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

If you specify these DBM option additionally when you log onto the Database Manager, then the DBM command for opening an SQL session is implicitly executed (see: sql_connect).

If you additionally specify a database user's user data, then the SQL session is opened with this data for the specified database instance. If you do not specify a user, the Database Manager default value is used (see: Concepts of the Database System, Database Manager User).

Opening an SQL session with the default value 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.

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

Note the different meanings of the command with uppercase and lowercase specification.

-uSQL: specify the database user identified by user name and password

-USQL: logon with a database user’s user key stored in the XUSER file

See also: XUSER

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

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

Syntax

-uSQL [<database_user>,<database_user_password>] | -USQL <user_key>

Examples for -uSQL

Logging on to the Database Manager CLI as operator OLEG with password MONDAY, connecting to the DEMODB database instance, executing the SQL statement to display the content of the customer  database table without specifying a database user:

>dbmcli -u OLEG,MONDAY -d DEMODB -uSQL -c db_execute SELECT * FROM customer

OK

END

3000;'Mrs';'Jenny';'Porter';'10580';'1340 N.Ash Street, #3'

3100;'Mr';'Peter';'Brown';'48226';'1001 34th Str., APT.3'

3200;'Company';(null);'Datasoft';'90018';'486 Maple Str.'

3300;'Mrs';'Rose';'Brian';'75243';'500 Yellowstone Drive, #2'

3400;'Mrs';'Mary';'Griffith';'20005';'3401 Elder Lane'

3500;'Mr';'Martin';'Randolph';'60615';'340 MAIN STREET, #7'

...

...

Logging on to the Database Manager CLI as operator OLEG with password MONDAY, connecting to the DEMODB database instance, executing the SQL statement to display the content of the customer  database table as database user MONA with the password RED:

>dbmcli -u OLEG,MONDAY -d DEMODB -uSQL MONA,RED db_execute SELECT * FROM customer

OK

END

3000;'Mrs';'Jenny';'Porter';'10580';'1340 N.Ash Street, #3'

3100;'Mr';'Peter';'Brown';'48226';'1001 34th Str., APT.3'

3200;'Company';(null);'Datasoft';'90018';'486 Maple Str.'

3300;'Mrs';'Rose';'Brian';'75243';'500 Yellowstone Drive, #2'

3400;'Mrs';'Mary';'Griffith';'20005';'3401 Elder Lane'

3500;'Mr';'Martin';'Randolph';'60615';'340 MAIN STREET, #7'

...

...

Example for -USQL

Logging on to the Database Manager CLI as operator OLEG with password MONDAY, connecting to the DEMODB database instance, executing the SQL statement to display the content of the customer  database table for the database user registered with the user key MOKEY:

>dbmcli -u OLEG,MONDAY -d DEMODB -USQL MOKEY db_execute SELECT * FROM customer

OK

END

3000;'Mrs';'Jenny';'Porter';'10580';'1340 N.Ash Street, #3'

3100;'Mr';'Peter';'Brown';'48226';'1001 34th Str., APT.3'

3200;'Company';(null);'Datasoft';'90018';'486 Maple Str.'

3300;'Mrs';'Rose';'Brian';'75243';'500 Yellowstone Drive, #2'

...

...

...

 

Leaving content frame