[GRASS-user] division in v.db.update or sql expression + db.execute results always "zero"

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Thu May 28 06:55:52 EDT 2009


Nikos:
> #using grass6_dev, compiled some weeks ago
...
> # sql expression
> echo "UPDATE sample_1_grid_points SET exprtest=burned_pix / 10" |
> db.execute

> and I always get a "0". Multiplication, addition and subtraction work
> fine but division seems not.

Not always. The problem is that the decimals are not printed so I see
only the leading 0 and the ".xxx" is missing.

For example:

* column "burned_pix" has min=1, max=281
* division by 10 gives numbers from 0 to 28
* division by 100 gives numbers from 0 to 2

successively, division with a denominator > nominator _prints-out_ zero
as a result.

Before testing with spearfish...
> ...Is this a bug?

Nikos

> [1] http://n2.nabble.com/Fwd%
> 3A-calculate-values-of-an-attribute-table-column-tc1885693.html#a1885698



More information about the grass-user mailing list