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

 

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 Note

By contrast, errors that occur during execution of the cmd method (Loader class) do trigger exceptions.

End of the note.

Features

Syntax Syntax

  1. rawCmd (cmd_string)
End of the code.
rawCmd Method: Attributes

Attribute

Description

cmd_string

Loader command

Result
  • Successful execution:

    OK

    Result of the DBM command

  • If an error occurs:

    ERR

    Error message

Example

  • You send a valid SQL statement:

    Syntax Syntax

    1. result = session.rawCmd ('CREATE TABLE testtable2 (colname INTEGER)') print repr (result)
    End of the code.

    'OK \n'

  • You send an invalid Loader command:

    Syntax Syntax

    1. result = session.rawCmd ('invalid command') print repr (result)
    End of the code.

    'ERR\n-25010\nSQL error -3005 = Invalid SQL statement (error position: 1)'