src/odbcn/errors

  Source   Edit

Helpers for getting error information on ODBC handles.

Types

OdbcError = object
  state*: OdbcState
  native*: TSqlInteger
  msg*: string
  Source   Edit
OdbcErrors = object
  retVal*: TSqlSmallInt
  procName*: string
  handleTy*: string
  errs*: seq[OdbcError]
  Source   Edit
OdbcException = object of CatchableError
  Source   Edit
OdbcState = array[6, TSqlChar]
  Source   Edit

Procs

proc `$`(x: OdbcState): string {....raises: [], tags: [].}
  Source   Edit
proc getDiagMsg(handle: SqlHandle; handleKind: TSqlSmallInt): seq[OdbcError] {.
    ...raises: [], tags: [].}
Get all messages (warnings and errors) associated with actions done with the given handle.   Source   Edit
proc raiseOdbcException(errs: OdbcErrors) {....raises: [OdbcException], tags: [].}
  Source   Edit
proc raiseOdbcException(errs: openArray[OdbcError]) {....raises: [OdbcException],
    tags: [].}
  Source   Edit
proc toString(x: openArray[char | byte]): string
  Source   Edit

Macros

macro odbcSimpleCheck(handle: SqlHandle; kind: TSqlSmallInt;
                      stmt, actions: untyped): TSqlSmallInt
If stmt evaluates to false, use the return value of the ODBC call to get all errors.   Source   Edit

Templates

template odbcCheck(handle: SqlHandle; kind: TSqlSmallInt; stmt)
  Source   Edit
template odbcCheckRet(handle: SqlHandle; kind: TSqlSmallInt; stmt): TSqlSmallInt
  Source   Edit