[unixODBC-support] select on oracle table via unixODBC only returns partial result

Stefan.Immel at stroeher.de Stefan.Immel at stroeher.de
Mon Oct 13 08:06:57 BST 2014


>> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20141013/6754d854/attachment.html>


More information about the unixODBC-support mailing list