[gdal-dev] ORA-01406 error when reading many attributes from Oracle

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Wed Oct 17 02:03:32 PDT 2012


Eli Adam <eadam <at> co.lincoln.or.us> writes:

> 
> Jukka,
> 
> > Could it be possible that OCI driver reserves too little of some 
resoursesand
> > fails because of that with large records?  I am now running a query 
with minimum
> > set of columns in my query and ogr2ogr is running well and I believe
it will
> > convert all the million rows from the view now.
> >
> > The view schema does not look extra hard for me. There are 21 
attributes in the
> > view and the longest VARCHAR2 is just 100 chararters long.
> 
> This may be overly simplistic, but does the cast operator do anything?
> 
> SELECT *, CAST(OGR_STYLE AS character(255)) FROM rivers

It does not do anything with OGR_STYLE because I do not have such but I 
believe your purpose was just to give an example. CAST did not help me 
with the problematic VARCHAR2 field I managed to put into jail because 
of making troubles but perhaps I do not know how to use it correctly.

I suspect that the reason for the trouble is that this field is a
17 character wide VARCHAR2 and I have in the data values like
"ÖVRE SÖDERGÄRDAN ". Database is using UTF-8 and Ö,Ö and Ä are
taking more than one byte each. Perhaps OCI driver develops come
from some ASCII country and did not bother to think about Oracle's
character and byte semantics throughly. It seems somehow fuzzy for
me even after reading this article
http://myorastuff.blogspot.fi/2009/02/character-and-byte-
semantics-in-oracle.html
 



More information about the gdal-dev mailing list