Background documentationsql_executenice Locate this document in the navigation structure

 

Use his command to transfer an SQL statement to the database.

Unlike the sql_execute command, in the reply to this command one data record after another is displayed.

When you execute this command, it implicitly opens a session with the database and ends the session as soon as the command has been executed. This database session is opened in AUTOCOMMIT mode, in other words, each SQL statement you execute is automatically completed with a COMMIT statement.

After you have executed the SQL statement, the system returns an OK message or displays the first data record of the reply. To display all the other data records one by one, use the sql_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.

Structure

sql_executenice <statement>

Options

Option

Description

<statement>

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

Call Database Manager CLI in session mode, log on as the operator OLEG with the password MONDAY, connect to the database DEMODB, and display the columns of the USERS table one by one together with their associated comments:

>dbmcli -u OLEG,MONDAY -d DEMODB

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

OK

CONTINUE

COLUMNNAME = 'OWNER'

COMMENT = (LOB)

---

dbmcli on demodb>sql_fetchnice

OK

CONTINUE

COLUMNNAME = 'GROUPNAME'

COMMENT = (LOB)

---

dbmcli on demodb>sql_fetchnice

...

...

More Information

Concepts of the Database System, SQL