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
By contrast, errors that occur during execution of the cmd method (sdb.dbm module) do trigger exceptions.
Syntax
rawCmd (cmd_string)
Attribute |
Description |
---|---|
cmd_string |
DBM command |
Successful execution:
OK
Result of the DBM command
If an error occurs:
ERR
Error message
You query the operational state of the database using db_state the DBM command:
Syntax
result = session.rawCmd ('db_state') print repr (result)
'OK\nState\nOFFLINE\n'
You enter an invalid DBM command:
Syntax
result = session.rawCmd ('invalid command') print repr (result)
'ERR\n-24977,ERR_COMMAND: unknown command "invalid"\n'
Database Manager CLI, Overview of all DBM Commands