[GRASS-dev] db function needed to check if column exists in table
Martin Landa
landa.martin at gmail.com
Mon Jan 30 06:04:23 EST 2012
Hi,
2012/1/30 Markus Metz <markus.metz.giswork at googlemail.com>:
>> 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(). Probably candidate for new error handler (see
[1]) which would close DB connections, close input vector map, and
delete output vector map.
Martin
[1] http://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/Vlib/handler.c#L26
--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
More information about the grass-dev
mailing list