[freetds] Obtaining diagnostic messages

Igor Korot ikorot01 at gmail.com
Mon Jul 27 17:46:59 EDT 2020


Hi,

On Mon, Jul 27, 2020 at 1:16 PM Bruce Seely <bseely at stsci.edu> wrote:
>
> 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?

Can you show the code of how do you call SQLGetDiagRec() and what is happening?

Thank you.

>
> Thank you,
> Bruce
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list