[GRASSLIST:7296] Re: db.* commands

Moritz Lennert mlennert at club.worldonline.be
Fri Jun 24 06:41:55 EDT 2005

On Fri, June 24, 2005 12:39, Aldo Clerici said:
> Dear GRASSusers and developers,
> I'm having some trouble with db.* commands and expecially with db.execute,
> surely due to my poor knowledge of SQL language.
> In the manual is written that db.execute executes any SQL statement, but in
> the "GRASS SQL Interface" manual page
> (..../grass-6.1.cvs/docs/html/sql.html) is specified that only a limited set
> of SQL functions and operators are supported.
> If this is correct I think it would be very useful to specify these
> limitations in the db.execute manual page.

At the bottom of the db.execute man page you can see a link to the "GRASS SQL
interface" which gets you this page:

> Furthermore it seems to me that there are other limitations regarding the
> variable types. In fact in the suggested "SQL Guide and reference"
> (www.redhat.com/docs/manuals/database/RHHDB-2.1-Manual/sql/sqlreference.html
> ) a long list of data types is reported, but actually only some of them are
> accepted by db.execute (I tried successfully int, double, varchar(n)).
> In conclusion the question is: is there a manual (or tutorial) where the
> functions, operators and data types accepted by db.execute are reported?

Some of this information is in the above page. The problem with types is that
it depends on the database backend which types are supported.

> A second point is that I cannot realize why the command:
> echo "SELECT * FROM <vectormap>" | db.select
> works correctly, while:
> echo "SELECT * FROM <vectormap>" | db.execute
> doesn't.

db.select is for selecting.
db.execute is for table "maintenance".

Why this is so IOW why db.execute doesn't do what it promises, i.e. "- Execute
any SQL statement", Radim will have to tell you. Maybe the man page should be
more explicit on this.


More information about the grass-user mailing list