0

I am running GRASS GIS 6.4.1 on Ubuuntu, and I am trying to join two tables to create a new table using the following SQL query in db.execute:

echo "CREATE TABLE landcover_new AS SELECT * FROM landcover OUTER JOIN landcover_legend ON landcover.CODE_00 = landcover_legend.CODE3" | db.execute

I receive the following:

(Thu Jan 30 14:59:23 2014)                                                      
db.execute input=/home/mightyoak/grassdata/Majorca/PERMANENT/.tmp/ubuntu/2348.6 
DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "echo": syntax error
ERROR: Error while executing: 'echo "CREATE TABLE landcover_new AS SELECT * FROM landcover OUTER JOIN landcover_legend ON landcover.CODE_00 = landcover_legend.CODE3" | 
db.execute
'
(Thu Jan 30 14:59:23 2014) Command finished (0 sec)  

What could be the syntax error here?

Dan
  • 3,246
  • 1
  • 32
  • 52

0 Answers0