[GRASS-dev] [bug #4141] (grass) more sql statements for db.execute

guest wrote (Mon, Mar 6 2006 17:36:36):

maybe this sql statement support could be added to db.execute as well:

this doesn't work:
echo "SELECT gkz,name,bev0100,bevm0100,bevw0100 FROM stand,testregion WHERE
plz = gkz" | db.execute

this is fine:
echo "SELECT gkz,name,bev0100,bevm0100,bevw0100 FROM stand,testregion WHERE
plz = gkz" | psql -U dassau ifak

By accident I have laerned today that db.execute is not supposed to support
SELECT query. We have db.select for that. In that case, do we call the case
closed?

Maciek

-------------------------------------------- Managed by Request Tracker

On Mon, 2007-10-08 at 22:44 +0200, Maciek Sieczka via RT wrote:

guest wrote (Mon, Mar 6 2006 17:36:36):

> maybe this sql statement support could be added to db.execute as well:
>
> this doesn't work:
> echo "SELECT gkz,name,bev0100,bevm0100,bevw0100 FROM stand,testregion WHERE
> plz = gkz" | db.execute
>
> this is fine:
> echo "SELECT gkz,name,bev0100,bevm0100,bevw0100 FROM stand,testregion WHERE
> plz = gkz" | psql -U dassau ifak

By accident I have laerned today that db.execute is not supposed to support
SELECT query. We have db.select for that. In that case, do we call the case
closed?

Maciek

(I didn't follow the entire thread, so my comments may be useless.
YMMV. :slight_smile:

Personally, I'd like db.select merged into db.execute. I don't use the
db.* commands daily and I've fallen into the above case before.
However, I quickly remember the more appropriate usage.

OTOH, db.execute isn't supposed to return and resulting set, which is
why db.select exists (to my knowledge). I've committed a change in CVS
to db.execute.html noting this and suggests using db.select.

I would consider this closed.

--
73, de Brad KB8UYR/6 <rez touchofmadness com>

Maciek wrote:
> By accident I have laerned today that db.execute is not supposed to
> support SELECT query. We have db.select for that. In that case, do we
> call the case closed?

Brad Douglas wrote:

Personally, I'd like db.select merged into db.execute. I don't use the
db.* commands daily and I've fallen into the above case before.
However, I quickly remember the more appropriate usage.

OTOH, db.execute isn't supposed to return and resulting set, which is
why db.select exists (to my knowledge). I've committed a change in CVS
to db.execute.html noting this and suggests using db.select.

IIRC in an old post Radim explained why that must be, but can't find it
now.

I would consider this closed.

still outstanding: db.execute needs to throw an error- not segfault -when
passed SELECT.

Hamish