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

 

cmd is a method of the Loader class (loader module). You use this method to send a Loader command $cmd_string to the Loader.

Syntax Syntax

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

More information: Loader, Loader Commands and SQL Statements

Result

The result of the Loader command is returned.

If the Loader server returns an error, an exception of the LoaderError (loader module) class is triggered.

Example

You specify a valid Loader command:

$result = $session->cmd ('CREATE TABLE testtable1 (colname INTEGER)') print "result: '$result'\n";

Output:

result: ''

You specify an invalid Loader command:

$result = $session->cmd ('invalid command') print "result: '$result'\n";

Output:

Error Loader Server: SQL error -3005 = Invalid SQL statement error position: 1) at /opt/sdb/misc/SAP/DBTech/loader.pm line 89.