[GRASS-user] grass v.db.join

Gary Nobles garynobles at yahoo.com
Fri Mar 12 06:07:37 EST 2010


Hi I have a set of points and I have a database table

I have imported the point dataset into the database and it is queriable from
grass

I want to join this data to another table

+---+-------------+    +-----------+-----------
|cat|SquareNumber|     |FindNumber|More data....
|1   |1                 |     |1              |More data....
|2   |2                 |     |2              |More data....
|3   |3                 |     |2             |More data....

I want a join on SquareNumber=FindNumber

As you will see it is a 1 to many relationship

I use  v.db.join bone_points col=SquareNumber otable=Zoological
ocol=FindNumber

and i get the error

DBMI-MySQL driver error:
Cannot execute:
UPDATE bone_points SET SiteCode=(SELECT SiteCode
FROM Zoological WHERE Zoological.FindNumber=bone_points.SquareNumber)
Subquery returns more than 1 row

ERROR: Error while executing: 'UPDATE bone_points SET SiteCode=(SELECT
       SiteCode
       FROM Zoological WHERE
       Zoological.FindNumber=bone_points.SquareNumber)'


This is because of more than 1 row being returned, is there anyway I can do
this? 
I need a 1 to many relationship!

Thank you

Gary
-- 
View this message in context: http://n2.nabble.com/grass-v-db-join-tp4721541p4721541.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list