Re: [GRASS-dev] db function needed to check if column exists in table

2012-01-30 Thread Glynn Clements
Markus Metz wrote: > >>>     db_get_column(driver, hcolumn,key, &column); > >>>     if (!column) > >>>         G_fatal_error(_("Missing column <%s> in table <%s>"), hcolumn, > >>> table); > >>> > > > > in this case you would probably need to close DB connection before > > calling G_fatal_error()

Re: [GRASS-dev] db function needed to check if column exists in table

2012-01-30 Thread Markus Metz
On Mon, Jan 30, 2012 at 12:04 PM, Martin Landa wrote: > Hi, > > 2012/1/30 Markus Metz : >>>     db_get_column(driver, hcolumn,key, &column); >>>     if (!column) >>>         G_fatal_error(_("Missing column <%s> in table <%s>"), hcolumn, >>> table); >>> > > in this case you would probably need to

Re: [GRASS-dev] db function needed to check if column exists in table

2012-01-30 Thread Markus Metz
On Mon, Jan 30, 2012 at 11:38 AM, Markus Neteler wrote: > Hi > > to my knowledge no DBMI function exists yet to check if a column exists > in (vector) table. > > Suggestions: > >     db_get_column(driver, hcolumn,key, &column); >     if (!column) >         G_fatal_error(_("Missing column <%s> in t

[GRASS-dev] db function needed to check if column exists in table

2012-01-30 Thread Markus Neteler
Hi to my knowledge no DBMI function exists yet to check if a column exists in (vector) table. Suggestions: db_get_column(driver, hcolumn,key, &column); if (!column) G_fatal_error(_("Missing column <%s> in table <%s>"), hcolumn, table); Or this one (used in r50492, here modifi