rawCmd is a method of the Loader class (sdb.loader module) for sending Loader commands and SQL statements to the Loader server. Errors returned by the Loader server do not trigger an exception.
Note
By contrast, errors that occur during execution of the cmd method (Loader class) do trigger exceptions.
Syntax
rawCmd (cmd_string)
Attribute |
Description |
---|---|
cmd_string |
Loader command |
Successful execution:
OK
Result of the DBM command
If an error occurs:
ERR
Error message
You send a valid SQL statement:
Syntax
result = session.rawCmd ('CREATE TABLE testtable2 (colname INTEGER)') print repr (result)
'OK \n'
You send an invalid Loader command:
Syntax
result = session.rawCmd ('invalid command') print repr (result)
'ERR\n-25010\nSQL error -3005 = Invalid SQL statement (error position: 1)'