Skip to content
Ryan Culpepper edited this page Mar 18, 2018 · 11 revisions

ODBC DB2 Notes

Issue: decimal/numeric results don't work

This page suggests that DB2 does not support SQLSetDescField, which means that the set-numeric-descriptors method (which sets the precision, etc) won't work.

In fact, when I check the result of (SQLSetDescField/Int hdesc i SQL_DESC_TYPE SQL_C_NUMERIC), I get -1 (SQL_ERROR), but no diagnostic.

These docs indicate that the current code is using the wrong convention for calling SQLSetDescField with an integer value, but after fixing that issue the function still returned -1 without diagnostic.

I also tried changing the numeric/decimal case to use SQL_C_NUMERIC directly rather than SQL_ARD_TYPE, but it still failed (but with a different message).

Clone this wiki locally