[GRASS-SVN] r65424 - grass/branches/releasebranch_7_0/vector/v.random
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jun 8 14:46:28 PDT 2015
Author: martinl
Date: 2015-06-08 14:46:28 -0700 (Mon, 08 Jun 2015)
New Revision: 65424
Modified:
grass/branches/releasebranch_7_0/vector/v.random/main.c
Log:
v.random: add dblink after creation of attribute table
(merge r65343 from trunk)
Modified: grass/branches/releasebranch_7_0/vector/v.random/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.random/main.c 2015-06-08 21:34:16 UTC (rev 65423)
+++ grass/branches/releasebranch_7_0/vector/v.random/main.c 2015-06-08 21:46:28 UTC (rev 65424)
@@ -241,14 +241,11 @@
db_begin_transaction(driver);
db_init_string(&sql);
+
+ /* Create table */
sprintf(buf, "create table %s (%s integer, %s %s)", Fi->table, GV_KEY_COLUMN,
parm.zcol->answer, parm.ztype->answer);
db_set_string(&sql, buf);
- Vect_map_add_dblink(&Out, 1, NULL, Fi->table, GV_KEY_COLUMN, Fi->database,
- Fi->driver);
-
- /* Create table */
- G_debug(3, db_get_string(&sql));
if (db_execute_immediate(driver, &sql) != DB_OK) {
G_fatal_error(_("Unable to create table: %s"),
db_get_string(&sql));
@@ -285,6 +282,9 @@
G_fatal_error(_("You have created unsupported column type. This module supports only INTEGER"
" and DOUBLE PRECISION column types."));
}
+
+ Vect_map_add_dblink(&Out, 1, NULL, Fi->table, GV_KEY_COLUMN, Fi->database,
+ Fi->driver);
}
Vect_hist_command(&Out);
More information about the grass-commit
mailing list