Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to concatenate two fields into one new field in GRASS, but I am unable to get the syntax to work. Ideally, I would like "FIELD1" and "FIELD2" concatenated together in "FIELD3". All fields are VARCHARs. I have tried:

v.db.update layername col=FIELD2 value=FIELD1+FIELD2

using many combinations of +, ||, &, and wrapping in single and double quotes all to no avail. Can someone provide some guidance on the required syntax?

share|improve this question
    
I should note I am using SQLLite backend, and was able to perform the operation directly in the database using exactly the syntax I expected (using simple || between field names). It would still be interesting to know how to do it in GRASS though, for future reference. –  Darren Cope Feb 1 '13 at 16:36
    
I have updated the manual with Micha's solution: grass.osgeo.org/grass70/manuals/sql.html –  markusN Feb 12 '13 at 20:28

1 Answer 1

up vote 2 down vote accepted

Try:

v.db.update layername col=FIELD2 qcolumn="FIELD1 || FIELD2"
share|improve this answer
    
Thanks Micha! Apparently somewhere in my combination of things, I missed this one. I went back and forth between using 'qcolumn' and 'value' and apparently didn't try all possibilities with both! –  Darren Cope Feb 5 '13 at 13:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.