Background documentationdb_executenice Locate this document in the navigation structure

 

With this DBM command you send an administration command or SQL statement to the database. However, for SQL statements in particular it is intended to be used via a programming interface.

Unlike when you use the DBM command db_execute, you want the reply to display one data record after another.

When you execute this command, the system implicitly opens a session with the database and then ends the session once the command has been executed. This database session is opened in AUTOCOMMIT mode. If you specify an SQL statement, it is automatically completed with a COMMIT statement.

After you execute the administration command or the SQL statement, the system returns an OK message or displays the first data record of the reply. To display the next data record, use the db_fetchnice DBM command.

For more information about SQL statements, see the SQL Reference Manual and SQL Tutorial.

Prerequisites

  • You are working in the session mode of Database Manager CLI.

  • If you want to execute administration commands, you need the AccessUtility server permission.

  • If you want to execute SQL statements, you need the AccessSQL server permission.

Structure

db_executenice [<user_type>] <statement>

Options

Option

Description

<user_type>

User type, possible values are:

DBM: the first DBM operator

DBA: the database administrator

SAP: a special database user in connection with SAP applications

<statement>

Administration command or SQL statement

Result

OK

[END | CONTINUE]

[<record>]

Values for the Reply Fields

Value

Description

END

The complete reply was output.

CONTINUE

More data records are available but were not transferred due to the limited size of the reply package.

<record>

A data record of the result of the SQL statement

The fields in a data record are separated by semicolons. Character strings are output in single quotation marks.

In the event of errors, see Reply Format.

Example

Log on to Database Manager CLI in session mode as the operator OLEG with the password MONDAY, connect to the database DEMODB, display the columns of the USERS table one-by-one with comments:

>dbmcli -u OLEG,MONDAY -d DEMODB

dbmcli on DEMODB>db_executenice SELECT columnname, comment FROM domain.columns WHERE tablename = 'USERS'

OK

CONTINUE

COLUMNNAME = 'OWNER'

COMMENT = (LOB)

---

Display the next data record:

dbmcli on DEMODB>db_fetchnice

OK

CONTINUE

COLUMNNAME = 'GROUPNAME'

COMMENT = (LOB)

---

Display the next data record:

dbmcli on DEMODB>db_fetchnice

...

...

More Information

Concepts of the Database System, SQL