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.
Syntax
cmd (cmd_string)
Attribute |
Description |
---|---|
cmd_string |
DBM command |
Successful execution: result of the DBM command
If an error occurs: exception of the DBMServError class (sdb.dbm module)
You query the operational state of the database using the db_state DBM command:
Syntax
result = session.cmd ('db_state') print repr (result)
'State\nOFFLINE\n'
You enter an invalid DBM command:
Syntax
result = session.cmd ('invalid command') print repr (result)
Traceback (most recent call last):
[...]
dbm.DBMServError: [-24977] Unknown DBM command "invalid"
Database Manager CLI, Overview of all DBM Commands