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

 

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

Errors returned by the Loader server do not raise an exception. The return code starts with OK if the command was executed successfully; it starts with ERR if the command failed.

Syntax Syntax

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

More information: Loader, Loader Commands and SQL Statements

Result

The result of the Loader command is returned.

Example

You specify a valid Loader command:

$result = $session->cmd ('CREATE TABLE testtable2 (colname INTEGER)')

print "result: '$result'\n";

Output:

result: 'OK

'

You specify an invalid Loader command:

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

print "result: '$result'\n";

Output:

result: 'ERR -25010 SQL error -3005 = Invalid SQL statement (error position: 1)'

More Information

cmd Method (Loader Class)