[GRASS-dev] SQLite driver problem

Moritz Lennert mlennert at club.worldonline.be
Wed Dec 15 13:55:38 EST 2010


On 14/12/10 18:49, Moritz Lennert wrote:
>> I wonder
>> if we could trap "SELECT" in db.execute and point the user to db.select.
>> ?
>
> That's not as easy as it sounds, since you might have SELECT clauses in
> UPDATE and other db.execute clauses (e.g. INSERT INTO mytable SELECT x,
> y, z FROM othertable). So the trapping would have to be a bit more
> sophisticated, at least looking out for a SELECT at the beginning of the
> statement.

Even that would not work as some RDMS (e.g. PostgreSQL) allow a syntax 
such as

SELECT * INTO table2 FROM table1

(equivalent to CREATE TABLE table2 AS SELECT * FROM table1)

which is a db.execute statement...

Not sure that there is a better solution than the hint in the NOTES 
section of the man page Hamish pointed to.

Moritz



More information about the grass-dev mailing list