Browse Source

untested bugfix (merge from devel_branch6, https://trac.osgeo.org/grass/changeset/34540)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34541 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 16 years ago
parent
commit
51580e47ea
1 changed files with 4 additions and 2 deletions
  1. 4 2
      scripts/db.in.ogr/db.in.ogr.py

+ 4 - 2
scripts/db.in.ogr/db.in.ogr.py

@@ -96,8 +96,10 @@ def main():
 
 
     # rename ID col if requested from cat to new name
     # rename ID col if requested from cat to new name
     if key:
     if key:
-	grass.run_command('v.db.renamecol', quiet = True, map = output, layer = 1,
-			  column = (cat, key), stdout = nuldev, stderr = nuldev)
+	grass.run_command('db.execute', quiet = True, flags = 'f',
+			  stdin = "ALTER TABLE %s ADD COLUMN %s integer" % (output, key) )
+	grass.run_command('db.execute', quiet = True, flags = 'f',
+			  stdin = "UPDATE %s SET %s=cat" % (output, key) )
 
 
     # ... and immediately drop the empty geometry
     # ... and immediately drop the empty geometry
     vectfile = grass.find_file(output, element = 'vector', mapset = mapset)['file']
     vectfile = grass.find_file(output, element = 'vector', mapset = mapset)['file']