select on oracle table via unixODBC only returns partial result

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

select on oracle table via unixODBC only returns partial result

Stefan.Immel
>> Hi
>>
>> I have a hugh problem regarding connect via unixODBC to an oracle DB.
>> when I try to select all records from a rather large table I only get
>> very few as a result.
>>
>> "select * from schema.table "
>> returns
>>
>> >SQLRowCount returns -1
>> >162 rows fetched
>>
>> whereas
>>
>> "select count(*) from schema.table "
>>
>> returns
>> +-----------------------------------------+
>> | COUNT(*)  |
>> +-----------------------------------------+
>> | 121116    |
>> +-----------------------------------------+
>> SQLRowCount returns -1
>> 1 rows fetched
>>
>>
>> any idea what is causing this and how I can further debug it?
>
>Well, you can turn on odbc tracing in odbcinst.ini
>
>[ODBC]
>Trace=Yes
>TraceFile=/tmp/sql.log
>
>That may show a SQLFetch returning a unexpected error. I do very much
>doubt its down to unixODBC though, I would think its driver related.
>
>--
>nick

Thanks a lot, that helped. Just so that others can perhaps find this I write down what I did:



I enabled tracing and came to this result:

[ODBC][15897][1413180663.680219][SQLFetch.c][348]
                Exit:[SQL_ERROR]
                DIAG [S1000] [Oracle][ODBC][Ora]ORA-01406: Gelieferter Spaltenwert wurde abgeschnitten

which translates to this error:
ORA-01406: fetched column value was truncated


When I looked this up I came to the realisation that it had something to do with different character sets.

I changes NLS_LANG  to GERMAN_GERMANY.AL32UTF8 and now it works.

thanks again.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support