[GRASS-dev] SQLite driver problem

Markus Neteler neteler at osgeo.org
Tue Dec 14 10:11:45 EST 2010


Hi,

I have some troubles with the SQLite driver with a SELECT statement:

GRASS 6.4.1svn (patGB1):~ > echo 'SELECT cat FROM
MRR1_09_marked_csv_lines_id ' | db.execute
D2/3: dbDbmscap(): opendir
[/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/driver/db/]
D2/3: dbDbmscap(): opendir
[/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/driver/db/]
D3/3:
db_driver_open_database()
D3/3: name = '$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db'
D3/3: tokens[0] = $GISDBASE
D3/3:    -> /home/neteler/grassdata
D3/3: tokens[1] = $LOCATION_NAME
D3/3:    -> patGB1
D3/3: tokens[2] = $MAPSET
D3/3:    -> fra_sqlite
D3/3: tokens[3] = sqlite.db
D2/3: name2 = '/home/neteler/grassdata/patGB1/fra_sqlite/sqlite.db'
D3/3: sql: SELECT cat FROM MRR1_09_marked_csv_lines_id

D3/3: execute: SELECT cat FROM MRR1_09_marked_csv_lines_id

DBMI-SQLite driver error:
Error in sqlite3_step():
unknown error

ERROR: Error while executing: 'SELECT cat FROM MRR1_09_marked_csv_lines_id
       '


But within "sqlite3", the statement works:

sqlite3 $HOME/grassdata/patGB1/fra_sqlite/sqlite.db
SQLite version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT cat,count(length) FROM MRR1_09_marked_csv_lines_id
GROUP BY length;
23|23
39|16
90|29
...
sqlite>

I wonder what the problem could be...

Markus


More information about the grass-dev mailing list