[GRASS-user] Max length of sql_query in v.extract

Luigi Ponti lponti at infinito.it
Thu Jan 28 09:39:50 EST 2010


Thanks for your answer, Markus.

On 28/01/2010 14:57, Markus Neteler wrote:
> On Thu, Jan 28, 2010 at 1:34 PM, Luigi Ponti <lponti at infinito.it> wrote:
>   
>> On 28/01/2010 00:45, Markus Neteler wrote:
>>     
>>> On Wed, Jan 27, 2010 at 8:35 PM, Luigi Ponti <lponti at infinito.it> wrote:
>>>
>>>       
>>>> Hello,
>>>>
>>>> Is there a length limit to a "where" sql statement fed to v.extract?
>>>>
>>>> I am getting an
>>>> ...
>>>> Error in db_open_select_cursor()
>>>> ...
>>>> in the middle of a very long query.
>>>>
>>>>         
>>> [...]
>>         v.extract input=census_wake2000 output=census_extract_all_trt2000
>> where=
>>     
>
> [... very long WHERE suppressed...]
>
> (TRT2000='050100')or(TRT2000='050300')or(TRT2000='050400')or(TRT2000='050500')or(TRT2000='050600')or(TRT2000='050700')or(TRT2000='050800')or(TRT2000='050900')or(TRT2000='051000')or(TRT2000='051100')or(TRT2000='051200')or(TRT2000='051400')or(TRT2000='051501')or(TRT2000='051502')or(TRT2000='051600')or(TRT2000='051700')or(TRT2000='051800')or(TRT2000='051900')or(TRT2000='052001')or(TRT2000='052002')or(TRT2000='052101')or(TRT2000='052102')or(TRT2000='052201')or(TRT2000='052202')or(TRT2000='052301')or(TRT2000='052302')or(TRT2000='052401')or(TRT2000='052402')or(TRT2000='052404')or(TRT2000='052405')or(TRT2000='052501')or(TRT2000='052503')or(TRT2000='052504')or(TRT2000='052601')or(TRT2000='052602')or(TRT2000='052603')or(TRT2000='052701')or(TRT2000='052703')or(TRT2000='052704')or(TRT2000='052705')or(TRT2000='052801')or(TRT2000='052802')or(TRT2000='052803')or(TRT2000='052804')or(TRT2000='052805')or(TRT2000='052900')or(TRT2000='053001')or(TRT2000='053002')or(TRT2000='053101')or(TRT2000='053103')or(TRT2000='053104')or(TRT2000='053200')or(TRT2000='053402')or(TRT2000='053403')or(TRT2000='053404')or(TRT2000='053405')or(TRT2000='053406')or(TRT2000='053407')or(TRT2000='053501')or(TRT2000='053505')or(TRT2000='053506')or(TRT2000='053507')or(TRT2000='053508')or(TRT2000='053509')or(TRT2000='053510')or(TRT2000='053512')or(TRT2000='053513')or(TRT2000='053514')or(TRT2000='053515')or(TRT2000='053600')or(TRT2000='053703')or(TRT2000='053706')or(TRT2000='053707')or(TRT2000='053709')or(TRT2000='053710')or(TRT2000='053711')or(TRT2000='053712')or(TRT2000='053713')or(TRT2000='053714')or(TRT2000='053715')or(TRT2000='053716')or(TRT2000='053801')or(TRT2000='053802')or(TRT2000='053900')or(TRT2000='054001')or(TRT2000='054003')or(TRT2000='054004')or(TRT2000='054006')or(TRT2000='054007')or(TRT2000='054008')or(TRT2000='054009')or(TRT2000='054010')or(TRT2000='054102')or(TRT2000='054104')or(TRT2000='054105')or(TRT2000='054106')or(TRT2000='054107')or(TRT2000='054108')or(TRT2000='054109')or(TRT2000='054201')or(TRT2000='054202')or(TRT2000='054301')or(TRT2000='054302')or(TRT2000='054401')or(TRT2000='054402')
>   

Yes, that's very long. Would there be a better way of achieving this in 
GRASS e.g. via *.db.* commands or is v.extract a wrapper for them, and 
hence they would fail anyway?
Kind regards,
Luigi

> [...]
>
> I guess that we need to change to dynamic string length allocation here?
> The cut string is pretty close to the 1023 chars length.
>
> Markus
>
>   




More information about the grass-user mailing list