[freetds] Obtaining diagnostic messages

Bruce Seely bseely at stsci.edu
Mon Jul 27 13:55:54 EDT 2020


How can I get the error reason when an error code is returned by a call to SQLColAttribute?

SQLColAttribute is called with these arguments:
      SQLHSTMT        StatementHandle, odbc_hstmt
      SQLUSMALLINT    ColumnNumber, 1
      SQLUSMALLINT    FieldIdentifier, 1011
      SQLPOINTER      CharacterAttributePtr, STACK-ALLOCATED (SHORT-SIMPLE-ARRAY FOREIGN (65))
      SQLSMALLINT     BufferLength, 255 (also tried 65)
      SQLSMALLINT *   StringLengthPtr, STACK-ALLOCATED (SHORT-SIMPLE-ARRAY FOREIGN (2))
      SQLLEN *        NumericAttributePtr); 0

The returned value is -1.

When pending messages are retrieved using SQLGetDiagRec, no messages are found.
What can I do to determine why the call is failing?

Thank you,
Bruce


More information about the FreeTDS mailing list