Function documentationcmd Method (DBM Class) Locate this document in the navigation structure

 

cmd is a method of the DBM class (sdb.dbm module). You can use this method to send a DBM command to the DBM server.

Features

Syntax Syntax

  1. cmd (cmd_string)
End of the code.
cmd Method: Attributes

Attribute

Description

cmd_string

DBM command

Result

Example

  • You query the operational state of the database using the db_state DBM command:

    Syntax Syntax

    1. result = session.cmd ('db_state')
      print repr (result)
    End of the code.

    'State\nOFFLINE\n'

  • You enter an invalid DBM command:

    Syntax Syntax

    1. result = session.cmd ('invalid command')
      print repr (result)
    End of the code.

    Traceback (most recent call last):

    [...]

    dbm.DBMServError: [-24977] Unknown DBM command "invalid"

  • Example: Executing DBM Commands

More Information

Database Manager CLI, Overview of all DBM Commands