SybSQLContext class

index

# SybSQLContext

SybSQLContext installs the default callbacks.

### Super Class

- SybContext

### Included Modules

- SybConstant

### Methods

srvmsgCB ( con, msghash )
  This is the default Server Message Callback used in SybSQLclass.

  Parameters:

  - con
    SybConnection object which caused the message.

  - msghash
    msghash parameter's key is equivalent to the fieldname of CS_SERVERMSG structure.
    msghash parameter's value is equivalent to the field value of CS_SERVERMSG structure.

    Details for key-value pair for msghash parameter
    Key | Value
    --- | ---
    'msgnumber' | The server message number.
    'severity' | The severity of the message.
    'state' | The server error state.
    'line' | The line number that caused the message
    'status' | The status of the message
    'srvname' | The name of the server that generated the message.
    'text' | The text string of the server message.
    'proc' | The name of the stored procedure that caused the message.
    'sqlstate' | The byte string describing the error.

  Extend Error Data is not implemented, yet

  (Please see the Sybase OpenClient manual pages on Callbacks for further details.)

cltmsgCB ( con, msghash)
  This is the default Client Message Callback used in SybSQLclass.

  Parameters:

  - con
    SybConnection object which caused the message.

  - msghash
    msghash parameter's key is equivalent to the fieldname of CS_CLIENTMSG structure.
    msghash parameter's value is equivalent to the field value of CS_CLIENTMSG structure.

    Details for key-value pair for msghash parameter
    Key | Value
    --- | ---
    'msgstring' | The Client-Library message string.
    'osstring' | The OS error string.
    'sqlstate' | The byte string describing the error.
    'status' | 'first','last', or 'both'
    'msgnumber' | The Client-Library message number.
    'layer' | CS_LAYER(msg->msgnumber)
    'origin' | CS_ORIGIN(msg->msgnumber)
    'number' | CS_NUMBER(msg->msgnumber)
    'severity' | nil -- No error has occurred. The message is informational. 'CONFIG_FAIL' -- SyBase configuration error 'RETRY_FAIL' -- Probably it means query timeout 'API_FAIL' -- Probably it is means grammar mistake 'RESOIRCE_FAIL' -- Probably, it means a lack of resources 'COMM_FAIL' -- Error in the server communication 'INTERNAL_FAIL' -- The internal Client-Library error 'FATAL' -- A serious error has occurred 'unknown' -- Unknown

    (Please see the Sybase OpenClient manual pages on Callbacks for further details.)