Entering content frame

Procedure documentation db_execute Locate the document in the library structure

Use

You send an administration command or SQL statement to the database instance. Unlike when using the db_executenice DBM command, you want the reply to display as many data records as possible.

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.

With SELECT statements, the system displays the data records of the reply. If not all the data can be displayed because of limited space on the data store, you can use the db_fetch DBM command to display the remaining data records.

If you enter other SQL statements, the execution of the statement is confirmed with an OK message.

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

Prerequisites

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

·        If you want to execute administration commands, you need the AccessUtility server authorization.

·        If you want to execute SQL statement, you need the AccessSQL server authorization.

Syntax

db_execute [<user_type>] <statement>

Options

Option

Description

<user_type>

User type, possible values are:

DBM: first DBM operator

DBA: database administrator

SAP: special database user in connection with SAP applications

<statement>

Administration command or SQL statement

Reply

OK

[END|CONTINUE]

[<record>

<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 memory.

<record>

Result data of the SQL statements

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

...

Logging on to the Database Manager CLI in session mode as operator OLEG with the password MONDAY, connecting to the database instance DEMODB, displaying the columns of the USERS table with the relevant comments:

>dbmcli -u OLEG,MONDAY -d DEMODB

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

OK

END

'OWNER';(long)

'GROUPNAME';(long)

'USERNAME';(long)

'USERMODE';(long)

'CONNECTMODE';(long)

'MAXTIMEOUT';(long)

'COSTWARNING';(long)

'COSTLIMIT';(long)

'DEFAULTCODE';(long)

'CREATEDATE';(long)

'CREATETIME';(long)

'ALTERDATE';(long)

'ALTERTIME';(long)

'PWCREADATE';(long)

'PWCREATIME';(long)

'SERVERDB';(long)

'SERVERNODE';(long)

'USER_ID';(long)

'ISREPLICATIONUSER';(long)

'COMMENT';(long)

 

 

Leaving content frame