[GRASSLIST:7315] db.execute trouble

Dear GRASS community,
can somebody tell me why the UPDATE operation works with a simple
assignement like in:
echo "UPDATE soils SET area=1000 WHERE area > 200"| db.execute
but return an error with any kind of operation like for example:
echo "UPDATE soils SET area=area+1 WHERE area > 200"| db.execute
or even simply:
echo "UPDATE soils SET area=1+1 WHERE area > 200"| db.execute

The output error is:
DBMI-DBF driver error:
SQL parser error in statement:
UPDATE suoli SET area=area+1 WHERE area > 200"
Error in db_execute_immediate ()
ERROR: Error while executing: "UPDATE suoli SET area=area+1 WHERE area > 200
"

Many thanks to everybody

Aldo Clerici
Parma University

On Mon, 27 Jun 2005 10:43:02 +0200
"Aldo Clerici" <alcl01@ipruniv.cce.unipr.it> wrote:

Dear GRASS community,
can somebody tell me why the UPDATE operation works with a simple
assignement like in:
echo "UPDATE soils SET area=1000 WHERE area > 200"| db.execute
but return an error with any kind of operation like for example:
echo "UPDATE soils SET area=area+1 WHERE area > 200"| db.execute
or even simply:
echo "UPDATE soils SET area=1+1 WHERE area > 200"| db.execute

The output error is:
DBMI-DBF driver error:
SQL parser error in statement:
UPDATE suoli SET area=area+1 WHERE area > 200"
Error in db_execute_immediate ()
ERROR: Error while executing: "UPDATE suoli SET area=area+1 WHERE area > 200
"

Only a limited set of SQL functions and operators are currently supported.

Addition is not among them.

see the GRASS SQL help page:
  http://grass.ibiblio.org/grass61/manuals/html61_user/sql.html

Hamish

Hamish wrote:

> Dear GRASS community,
> can somebody tell me why the UPDATE operation works with a simple
> assignement like in:
> echo "UPDATE soils SET area=1000 WHERE area > 200"| db.execute
> but return an error with any kind of operation like for example:
> echo "UPDATE soils SET area=area+1 WHERE area > 200"| db.execute
> or even simply:
> echo "UPDATE soils SET area=1+1 WHERE area > 200"| db.execute
>
> The output error is:
> DBMI-DBF driver error:
> SQL parser error in statement:
> UPDATE suoli SET area=area+1 WHERE area > 200"
> Error in db_execute_immediate ()
> ERROR: Error while executing: "UPDATE suoli SET area=area+1 WHERE area > 200
> "

Only a limited set of SQL functions and operators are currently supported.

Addition is not among them.

see the GRASS SQL help page:
  http://grass.ibiblio.org/grass61/manuals/html61_user/sql.html

That page is somewhere between misleading and inaccurate.

First, it appears to relate specifically to the DBF driver, although
it doesn't say so.

Second, arithmetic expressions are supported, but only WHERE clauses,
not in SET clauses.

Given that the DBF driver already has the ability to evaluate
arithmetic expressions, it wouldn't be a lot of work to allow
expressions on the RHS of SET clauses. However, this would require
changes to the DBF driver.

--
Glynn Clements <glynn@gclements.plus.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hamish wrote:

On Mon, 27 Jun 2005 10:43:02 +0200
"Aldo Clerici" <alcl01@ipruniv.cce.unipr.it> wrote:

Dear GRASS community,
can somebody tell me why the UPDATE operation works with a simple
assignement like in:
echo "UPDATE soils SET area=1000 WHERE area > 200"| db.execute
but return an error with any kind of operation like for example:
echo "UPDATE soils SET area=area+1 WHERE area > 200"| db.execute
or even simply:
echo "UPDATE soils SET area=1+1 WHERE area > 200"| db.execute

The output error is:
DBMI-DBF driver error:
SQL parser error in statement:
UPDATE suoli SET area=area+1 WHERE area > 200"
Error in db_execute_immediate ()
ERROR: Error while executing: "UPDATE suoli SET area=area+1 WHERE area > 200
"

Only a limited set of SQL functions and operators are currently supported.

Addition is not among them.

see the GRASS SQL help page:
  http://grass.ibiblio.org/grass61/manuals/html61_user/sql.html

Would the latest changes to the sql expression parser
(http://grass.itc.it/pipermail/grass5/2005-June/018588.html and
following) change this ?

Moritz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCv8xZrIrMbm76jD8RAjRaAJ9zRjHH64H+Xd8drobz+44an5/JqwCcCaTU
iiTIzilSB2iyWL/wu3GuMKs=
=TdKv
-----END PGP SIGNATURE-----

Moritz Lennert wrote:

>>Dear GRASS community,
>>can somebody tell me why the UPDATE operation works with a simple
>>assignement like in:
>>echo "UPDATE soils SET area=1000 WHERE area > 200"| db.execute
>>but return an error with any kind of operation like for example:
>>echo "UPDATE soils SET area=area+1 WHERE area > 200"| db.execute
>>or even simply:
>>echo "UPDATE soils SET area=1+1 WHERE area > 200"| db.execute
>>
>>The output error is:
>>DBMI-DBF driver error:
>>SQL parser error in statement:
>>UPDATE suoli SET area=area+1 WHERE area > 200"
>>Error in db_execute_immediate ()
>>ERROR: Error while executing: "UPDATE suoli SET area=area+1 WHERE area > 200
>>"
>
>
>
> Only a limited set of SQL functions and operators are currently supported.
>
> Addition is not among them.
>
> see the GRASS SQL help page:
> http://grass.ibiblio.org/grass61/manuals/html61_user/sql.html

Would the latest changes to the sql expression parser
(http://grass.itc.it/pipermail/grass5/2005-June/018588.html and
following) change this ?

No. Those changes just fix and extend the syntax of arithmetic
expressions within WHERE clauses.

--
Glynn Clements <glynn@gclements.plus.com>

Dear reader

Today I started the GRASS 6.0.0 tutorial. I tried to load the Spearfish60
mapset, but when I click on the PERMANENT mapset and clock 'Enter Grass', an
error message pops up: 'invalid mapset'. Any Ideas what I should do?

Thank you
Kobus Bedeker

I hav got a series of Landsat Images I need to import into GRASS

The CD is an original EOSAT distribution filem and the The file Names
area as folows:

BAND1.DAT
TRAILER.DAT
README.TXT
HEADER.DAT
FFORMAT.TXT
BAND7.DAT
BAND6.DAT
BAND5.DAT
BAND4.DAT
BAND3.DAT
BAND2.DAT
TRAILER.TXT

As far as I can tell this is a FAST format, which should be possible
to import with r.in.gdla. However, all my intents to import the files
have failed.

Any help greatly appreciated

Cheers

Armando Scalise

I hav got a series of Landsat Images I need to import into GRASS

The CD is an original EOSAT distribution filem and the The file Names
area as folows:

BAND1.DAT
TRAILER.DAT
README.TXT
HEADER.DAT
FFORMAT.TXT
BAND7.DAT
BAND6.DAT
BAND5.DAT
BAND4.DAT
BAND3.DAT
BAND2.DAT
TRAILER.TXT

As far as I can tell this is a FAST format, which should be possible
to import with r.in.gdla. However, all my intents to import the files
have failed.

r.in.gdal is the correct module to use but you need to be more specific
about what the error was. Exact cut and paste of the error message is
preferable.

Hamish

s99171059@tuks.co.za wrote:

Today I started the GRASS 6.0.0 tutorial. I tried to load the Spearfish60
mapset, but when I click on the PERMANENT mapset and clock 'Enter Grass', an
error message pops up: 'invalid mapset'. Any Ideas what I should do?

For a start, don't try to use the PERMANENT mapset as the current
mapset.

The first time that you use a location, you should create a new
mapset.

--
Glynn Clements <glynn@gclements.plus.com>

On Mon, Jun 27, 2005 at 03:57:00PM +0200, s99171059@tuks.co.za wrote:

Dear reader

Today I started the GRASS 6.0.0 tutorial. I tried to load the Spearfish60
mapset, but when I click on the PERMANENT mapset and clock 'Enter Grass', an
error message pops up: 'invalid mapset'. Any Ideas what I should do?

Thank you
Kobus Bedeker

The settings must as follows:

GRASS database: directory which *contains* spearfish60
Location: spearfish60
Mapset: preferably create your own using the right "create" field

You can select PERMANENT mapset if you own it. Otherwise you can
use data stored in this mapsets from any other mapset created and
owned by you.

Hope this helps

Markus

In the below cmd, the scolumn=* seems to get ignored. If I drop smooth=*,
still gets ignored. If I use "scolumn=gibberish", it still gets ignored.

There isn't much in the documentation on use of "smoothing column". How
does one force use of the smoothing column?

v.surf.rst input=test_cat layer=0 zcolumn=flt1 scolumn=stdevds dmax=12.5
dmin=2.5 zmult=1 tension=40 smooth=0.01 segmax=40 npmin=200 -v
cvdev=test_cat_withcv