[GRASS-SVN] r65343 - grass/trunk/vector/v.random
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 31 07:44:14 PDT 2015
Author: martinl
Date: 2015-05-31 07:44:14 -0700 (Sun, 31 May 2015)
New Revision: 65343
Modified:
grass/trunk/vector/v.random/main.c
Log:
v.random: add dblink after creation of attribute table
Modified: grass/trunk/vector/v.random/main.c
===================================================================
--- grass/trunk/vector/v.random/main.c 2015-05-29 22:21:06 UTC (rev 65342)
+++ grass/trunk/vector/v.random/main.c 2015-05-31 14:44:14 UTC (rev 65343)
@@ -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