Opened 14 years ago

Closed 14 years ago

#1055 closed defect (invalid)

db.select can´t found columns generated by v.rast.stats with dbf driver

Reported by: jeleniste Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Database Version: 6.4.0 RCs
Keywords: dbf, db.select Cc:
CPU: Unspecified Platform: MSWindows XP

Description

if I try to use in sql parameter in where clausule column generated by v.rast.stats it return me error, column cant be found, but is presented in table output (if not used in where clausule), using in list of columns for select returns me error to

Change History (6)

comment:1 by martinl, 14 years ago

Component: defaultDatabase

in reply to:  description ; comment:2 by martinl, 14 years ago

Replying to jeleniste:

if I try to use in sql parameter in where clausule column generated by v.rast.stats it return me error, column cant be found, but is presented in table output (if not used in where clausule), using in list of columns for select returns me error to

g.copy vect=geology,geo --o
v.rast.stats vector=geo raster=elevation colprefix=elev --v
v.info -c geo | grep elevINTEGER|elev_n
DOUBLE PRECISION|elev_min
DOUBLE PRECISION|elev_max
DOUBLE PRECISION|elev_range
DOUBLE PRECISION|elev_mean
DOUBLE PRECISION|elev_stdde
DOUBLE PRECISION|elev_varia
DOUBLE PRECISION|elev_cf_va
DOUBLE PRECISION|elev_sum
v.db.select map=geo columns=cat,elev_n,elev_min where="elev_n not NULL"
cat|elev_n|elev_min
217|725565|80.929474
262|198686|75.525719
270|689296|55.578793
405|253653|90.39637
583|21656|118.640244
720|4807|102.848068
766|7086|113.913361
862|61710|91.674515
910|45044|73.698929
921|12563|115.666611
945|9|124.292007
946|4053|75.179901
948|872|118.361198

Seems to work... Did I understood well?

Martin

in reply to:  2 ; comment:3 by jeleniste, 14 years ago

Seems to work... Did I understood well?

Martin

No

Try db.select sql = "Select cat,elev_n,elev_min from geo where=elev_n not NULL"

this return me error

in reply to:  3 comment:4 by martinl, 14 years ago

Replying to jeleniste:

Try db.select sql = "Select cat,elev_n,elev_min from geo where=elev_n not NULL"

it should be

db.select sql="select cat,elev_n,elev_min from geo where elev_n not NULL"

so without = after where keyword.

Martin

comment:5 by jeleniste, 14 years ago

of coururse, but

db.select sql="select cat,elev_n,elev_min from geo where elev_n not NULL"

don´t work on my distribution

GRASS 6.4> db.select sql="select cat, slope_n from vvp_plochy where elev_n  not
 NULL"
DBMI-DBF driver error:
Column 'slope_n' not found
Error in db_open_select_cursor()

GRASS 6.4> 
GRASS 6.4> db.columns vvp_plochy
cat
CISLO_VVP
ID
NAZEV
slope__n
slope__min
slope__max
slope__ran
slope__mea
slope__std
slope__var
slope__cf_
slope__sum
GRASS 6.4>
slope__var
slope__cf_
slope__sum

Oh. I'm so sorry, my columns have two in prefix. My fault

comment:6 by neteler, 14 years ago

Resolution: invalid
Status: newclosed

As far as I understand, user error. Closing.

Note: See TracTickets for help on using tickets.