[GRASS-user] db.execute: SELECT STATEMENT

Markus Neteler neteler at itc.it
Tue Jan 30 04:15:29 EST 2007


Jarosław Jasiewicz wrote on 01/30/2007 09:38 AM:
> Hi
> Is 'db.excute' executeng SELECT statement for pg driver or 'db.select' 
> shall be used?
I think so but I never understodd why we have two commands.

> I found nothing about that in help pages, but in db.execute examples 
> are about all examples , but SELECT, so I can thing  db.execute cannot 
> exec SELECT statement

Right - which is confusing since the module says:
"db.execute  - Execute any SQL statement"
apparently wrong? Or a bug?

> The problem arises when I tried to select data from one table (based 
> on user click) and put them to another in one command and I recive error:
>
> DBMI pg ERROR
> cannot execute "SELECT max(grupa) FROM structura etc..."
>
For now, just use db.select instead.
But we should solve this confusion.
> I add, that combination can be execute in pgadmin without problem so 
> statements are good
It seems to be a (mysterious to me) limitation in db.execute.
The used function is "documented" here:
http://mpa.itc.it/markus/grass63progman/c__execute_8c.html#a0

Markus




More information about the grass-user mailing list