[GRASSLIST:3756] Re: db.execute
Michael Barton
michael.barton at asu.edu
Sun Jun 27 15:49:16 EDT 2004
Markus,
In part, I think this is another example of a problem that affects all
GRASS 5.7 GUI entries that use an argument with spaces. Commands that
require such entries include those that ask for sql statements or a
list of database fields. Somehow g_parser or G_PARSER() is translating
the single string argument as a list of separate entries. In other
words, the argument 'field1 int,field2 varchar(20),field3 double'
becomes 4 arguments "field1", "int,field2", "varchar(20),field3", and
"double".
I tried to report this a week or so back, but perhaps didn't explain it
well enough. Glynn Clements responded and, if I understand correctly,
he thinks it is somewhere in G_PARSER().
Michael
____________________
C. Michael Barton, Professor
School of Human Origins, Cultures, & Societies
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA
Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>
On Jun 26, 2004, at 10:01 PM, Multiple recipients of list wrote:
> From: Markus Neteler <neteler at itc.it>
> Date: June 26, 2004 11:45:39 AM MST
> To: Grasslist <GRASSLIST at baylor.edu>
> Subject: [GRASSLIST:3752] Re: db.execute
>
>
> On Fri, Jun 25, 2004 at 06:01:53PM +0200, Radim Blazek wrote:
>> On Friday 25 June 2004 17:43, Daniel Isenegger wrote:
>>> Hi
>>> i'm working on a suse 8.2 with grass57 (compiled from source) on a
>>> local
>>> Grass-DB:
>>>
>>> with:
>>> db.connect -p
>>> driver:dbf
>>> database:/data/gis/nfp48/nfp48/ipodlas0.1/grass/grassdata/
>>> UpperEngadine/dis
>>> en/dbf
>>>
>>> db.select-statement works well
>>> (echo "select defoliatio from defoliation_53_shp" | db.select)
>>>
>>> but db.execute statements fail, e.g.:
>>> echo 'create table test_table ("cat" int, "desc" text)' | db.execute
>>
>> 'text' is not supported by DBF, column names should not be quoted, try
>> echo 'create table test_table (cat int, desc varchar(50))' |
>> db.execute
>
> Also this suggestion fails (also the command given in the man page):
>
> echo 'create table test_table (cat int, desc varchar(50))' | db.execute
> DBMI-Postgres driver error:
> Cannot execute:
> create table test_table (cat int, desc varchar(50))
>
> ERROR: parser: parse error at or near "desc" at character 35
> WARNING: Error while executing: "create table test_table (cat int, desc
> varchar(50))
> "
>
> (here: PG driver)
>
> I don't know how to debug it...
>
>>> also db.driver fails with the error:
>>> error: can't read "opttype(1)": no such element in array
>>
>> db.drivers -p ? Command line or GUI?
>
> The GUI version gives that error.
>
> Markus
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2837 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20040627/b493861f/attachment.bin
More information about the grass-user
mailing list