[Harbour] New trouble with type from MS Sql

Mindaugas Kavaliauskas dbtopas at dbtopas.lt
Mon Feb 1 09:28:13 EST 2010


Hi,


Horodyski Marek (PZUZ) wrote:
> Mindaugas, I have new error from SQL Serwer :
> oErr:osCode_______     65531

65531 ~ -5
It is SQL_BIGINT.


> Where/how can I try improve it (in odbcdd.c) ? :
> ...
>          case SQL_TINYINT:
>          case SQL_SMALLINT:
>          case SQL_INTEGER:
>            pFieldInfo.uiType = HB_FT_INTEGER;
>            break;

Try to add the fourth case sentence:
    case SQL_BIGINT:

But I do not know how big is this "bigint" value. Please, try uncomment 
debug line:
    HB_TRACE( HB_TR_ALWAYS, ("field: name=%s type=%d len=%d dec=%d 
null=%d", pFieldInfo.atomName, iDataType, uiSize, iDec, iNull ) );
and report result for bigint filed type.

Testing of "big" values (larger that +/- 2^32) is also required to make 
support for bigint complete. Perhaps we will need to adjust code:

    case HB_FT_INTEGER:
    {
       long int  val = 0;
       if( SQL_SUCCEEDED( res = SQLGetData( hStmt, ui, SQL_C_LONG, &val, 
sizeof( val ), &iLen ) ) )
       {
          pItem = hb_itemPutNLLen( NULL, val, pField->uiLen );
       }
       break;
    }

to support all range of bigint values.


Regards,
Mindaugas


More information about the Harbour mailing list