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

 

rawCmd is a method of the DBM class (sdb.dbm module). You can use this method to send a DBM command to the DBM server. Errors returned by the DBM Server do not trigger exceptions.

Note Note

By contrast, errors that occur during execution of the cmd method (sdb.dbm module) do trigger exceptions.

End of the note.

Features

Syntax Syntax

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

Attribute

Description

cmd_string

DBM command

Result
  • Successful execution:

    OK

    Result of the DBM command

  • If an error occurs:

    ERR

    Error message

Example

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

    Syntax Syntax

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

    'OK\nState\nOFFLINE\n'

  • You enter an invalid DBM command:

    Syntax Syntax

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

    'ERR\n-24977,ERR_COMMAND: unknown command "invalid"\n'

More Information

Database Manager CLI, Overview of all DBM Commands