[gdal-dev] ogr2ogr -f OCI fails on Windows

Ivan Lucena lucena_ivan at hotmail.com
Fri Apr 18 09:55:42 PDT 2014


The driver should create the column as VARCHAR2, not VARCHAR [1]. It is wrong for several reasons [2] and there is a possibility that the amount of data you are loading is too big for the wrong data type. Can you change that code [1], compile and try again?

[1] - [http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp#L296]

[2] """
The VARCHAR2 subtypes STRING and VARCHAR have the same range of values as their base type. For example, VARCHAR is just another name for VARCHAR2.

You can use the VARCHAR2 subtypes for compatibility with ANSI/ISO and IBM types.



Currently, VARCHAR is synonymous with VARCHAR2. However, in future releases of PL/SQL, to accommodate emerging SQL standards, VARCHAR might become a separate datatype with different comparison semantics. It is a good idea to use VARCHAR2 rather than VARCHAR.
""" 
[ http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/datatypes.htm#i42580 ]


> Date: Fri, 18 Apr 2014 18:21:48 +0200
> Subject: Re: [gdal-dev] ogr2ogr -f OCI fails on Windows
> From: landa.martin at gmail.com
> To: lucena_ivan at hotmail.com
> CC: gdal-dev at lists.osgeo.org
> 
> Hi,
> 
> Dne 16. dubna 2014 22:37 Ivan Lucena <lucena_ivan at hotmail.com> napsal(a):
> 
> > Could you try yo run that command in PLSQL before loading thata data?
> >
> > SQL> ALTER SESSION SET NLS_LENGTH_SEMANTICS=CHAR;
> 
> I tried that and also setting environmental variable
> 
> SET NLS_LENGTH_SEMANTICS=CHAR
> 
> > And then ogr2ogr with -overwrite
> >
> > $ ogr2ogr -f OCI oci:user/passwd data\20140331_OB_564729_UKSH.xml.gz
> > -overwrite
> 
> but I don't see any extra info compared to that I already sent. Could
> it be related to
> 
> Warning 6: Can't create field DetailniTEAKod with type IntegerList on
> Oracle layers.  Creating as VARCHAR.
> OCI: Prepare(ALTER TABLE STAVEBNIOBJEKTY ADD "DetailniTEAKod" VARCHAR(2047))
> 
> ? Thanks, Martin
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140418/197e32a0/attachment.html>


More information about the gdal-dev mailing list