Opened 11 years ago

Closed 10 years ago

#1503 closed defect (fixed)

parser error with db.select

Reported by: hamish Owned by: grass-dev@…
Priority: minor Milestone: 6.5.0
Component: LibGIS Version: svn-develbranch6
Keywords: parser, db.select Cc:
CPU: x86-64 Platform: Linux

Description

NC2008 dataset in trunk:

GRASS7> db.select precip_30ynormals_g7 \
   sql="select annual from precip_30ynormals_g7 where cat=2"

Description:
 Selects data from attribute table (performs SQL query statement(s)).

Keywords:
 database, attribute table, SQL

Usage:
 db.select [-cdvt] [sql=string] [input=name] [table=name]
   [database=name] [driver=name] [fs=character] [vs=character]
   [nv=string] [output=name] [--overwrite] [--verbose] [--quiet]

[...]
ERROR: Option <sql> does not accept multiple answers

I guess it doesn't like the 'where cat=2' ?

v.db.select where="cat=2" seems ok though.

Hamish

Change History (5)

comment:1 by hamish, 11 years ago

Milestone: 7.0.06.5.0
Priority: normalcritical

this also happens in recent 6.5svn, but it seems to work ok in 6.4svn.

see also #1444 "g.parser does not filter for duplicate output map statements"

Hamish

in reply to:  description comment:2 by glynn, 11 years ago

Replying to hamish:

I guess it doesn't like the 'where cat=2'

No, it doesn't like you specifying the sql= option twice. Note that the default option is sql=, not table=.

comment:3 by hamish, 11 years ago

Version: svn-trunksvn-develbranch6

d'oh! the options got reordered..

I am not sure if this ticket should be closed as invalid, or if re-ordering the primary option in 6.x should be considered a break in backwards compatibility, although one that only bites those taking command line shortcuts. If it is, devbr6 should be put back to its old way before forgetting about this ticket.

Hamish

comment:4 by hamish, 11 years ago

Priority: criticalminor

comment:5 by hamish, 10 years ago

Resolution: fixed
Status: newclosed

devbr6 reordered back to the old way in r56074.

Note: See TracTickets for help on using tickets.