rawCmd is a method of the class Loader.
With this method you send a Loader command or an SQL statement to the Loader server. Errors returned by the Loader server do not trigger an exception.
By contrast, errors that occur during execution of the method cmd do trigger exceptions.
rawCmd (cmd_string)
cmd_string |
Loader command |
Result:
● Successful execution:
OK
Result of the DBM command
● if an error occurs:
ERR
Error message
● You send a valid SQL statement:
result = session.rawCmd
('CREATE TABLE testtable2 (colname INTEGER)')
print repr (result)
'OK \n'
● You send an invalid Loader command:
result = session.rawCmd
('invalid command')
print repr (result)
'ERR\n-25010\nSQL error -3005 = Invalid SQL statement (error position: 1)'