OracleSpatial driver - VARCHAR2(4000)

Fernando Simon fsimon at UNIVALI.BR
Thu Aug 23 12:48:25 EDT 2007


Hi all,
    The way that Jim used is the correct way. The purpose of the 
TEXT_SIZE is this, permit to read big strings. If remember, the default 
value (256), is because the cell space in DBF, for shapes, can't store 
values bigger than 256.
    The unique problem is that the usage of memory will increase, the 
Oracle driver will always use the 4000 bytes.
    We can improve this value (like 1024), but I believe that will cover 
just special cases, and the memory will be allocate without use.
    Best regards.

Fernando Simon

Umberto Nicoletti wrote:
> Your solution is ok and is the only way to read values longer than 256
> bytes from Oracle. We should definitely consider upping the the length
> of TEXT_SIZE to 4000 once for all. Please file a ticket at
> http://trac.osgeo.org/mapserver so that we can include it in the next
> releases.
>
> Regards,
> Umberto
>
> On 8/22/07, Jim Klassen <Jim.Klassen at ci.stpaul.mn.us> wrote:
>   
>> I am trying to access a spatial table with a VARCHAR2(4000) column from one
>> of our Oracle spatial databases. Things work great for mode=map, but for
>> mode=nquery I am getting an error returned by mapserver in
>> msOracleSpatialLayerGetShape() that Oracle had to truncate one of the
>> fields.
>>
>> I noticed that in maporaclespatial.c TEXT_SIZE is defined to be 256 and this
>> seems to be used to determine the size of the pointers and the max allowed
>> column length passed to oracle in OCIDefineByPos(...) on line 2155 in
>> msOracleSpatialLayerGetShape(). So, I changed TEXT_SIZE to 4000, and
>> recompiled Mapserver and now I get the expected result of the entire value
>> of the column being substituted into the nquery template.
>>
>> Are there any negative consequences of making this change (except for
>> greater memory usage) that I am not thinking about?
>>
>> Is there an easier way to allow columns with values > 256 characters to be
>> displayed in an nquery template that I overlooked?
>>
>> I am using Oracle 10gR1 and Mapserver 4.10.2.
>>
>>
>>     
>
>   



More information about the mapserver-dev mailing list