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

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Tue Oct 16 07:13:35 PDT 2012


Hi,

I have one view in Oracle 11 that I just cannot convert to another format with
ogr2ogr.

If I use -sql parameter "SELECT * FROM view" the conversion stops after couple
of thousands of lines with the following error

ERROR 1: ORA-01406: fetched column value was truncated
 in OCIStmtFetch

I found this explanation from internet

ORA-01406:	fetched column value was truncated
Cause:	In a host language program, a FETCH operation was forced to truncate a
character string. The program buffer area for this column was not large enough
to contain the entire string. The cursor return code from the fetch was +3.
Action:	Increase the column buffer area to hold the largest column value or
perform other appropriate processing. 

Could it be possible that OCI driver reserves too little of some resourses and
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.

-Jukka Rahkonen-



More information about the gdal-dev mailing list