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

Smith, Michael ERDC-RDE-CRREL-NH Michael.Smith at erdc.dren.mil
Wed Oct 17 03:29:00 PDT 2012


Jukka,

If the field is 17 char wide (rather than 17 bytes wide) then that is your
problem. A varchar2 column can use either char or byte specifications.

http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements001.htm#i
45694


If neither char or byte is specified, it defaults to your
NLS_LENGTH_SEMANTICS in the session that was in place when the table was
created. 

Mike

-- 
Michael Smith

US Army Corps
Remote Sensing GIS/Center



On 10/17/12 5:03 AM, "Jukka Rahkonen" <jukka.rahkonen at mmmtike.fi> wrote:

>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
> 
>
>_______________________________________________
>gdal-dev mailing list
>gdal-dev at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list