You transfer an SQL statement to the database instance.
Unlike when you use the DBM command sql_execute , you want the reply to display one data record after another.
When you execute this command, it implicitly opens a session with the database instance and then ends the session once the command has been executed. This database session is opened in AUTOCOMMIT mode, in other words, each SQL statement that is specified is automatically completed with a COMMIT statement.
After you execute 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.
See also:
Database Administration Tutorial, Operating Modes in the Database Manager CLI, Executing a Succession of Database Statements
Concepts of the Database System, SQL
● You are working in the session mode of the Database Manager CLI.
● You have the server authorization AccessSQL.
sql_executenice <statement>
<statement> |
SQL Statement |
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. |
Call the Database Manager CLI in session mode, log on as operator OLEG with password MONDAY, connect to the database instance DEMODB, display the columns of the USERS table record by record with the relevant 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 = (long)
---
dbmcli on demodb>sql_fetchnice
OK
CONTINUE
COLUMNNAME = 'GROUPNAME'
COMMENT = (long)
---
dbmcli on demodb>sql_fetchnice
...
...