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

 

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

Syntax Syntax

  1. $result = $session->cmd ($cmd_string);
End of the code.

More information: Database Manager CLI, Overview of All DBM Commands

Result

The result of the DBM command is returned.

If the DBM server returns an error, an exception of the class DBMServError is raised.

Example

You specify a valid DBM command.

$result = session->cmd ('db_state');

print "$result\n";

Output:

State

OFFLINE

You specify an invalid DBM command.

$result = $session->cmd ('invalid command');

print "$result\n";

Output:

Error DBM Server: -24977 ERR_COMMAND: unknown command "invalid" at /opt/sapdb/misc/SAP/DBTech/dbm.pm line 89.

More Information

rawCmd Method (DBM Class)