other versions
- wheezy 6.4.2-2
- jessie 6.4.4-1
- testing 7.2.0-2
- unstable 7.2.0-2
- experimental 7.2.1-1~exp1
| db.copy(1grass) | Grass User's Manual | db.copy(1grass) |
NAME¶
db.copy - Copy a table.KEYWORDS¶
database, attribute table, SQLSYNOPSIS¶
db.copyFlags:¶
- --overwrite
-
Allow output files to overwrite existing files
- --verbose
-
Verbose module output
- --quiet
-
Quiet module output
Parameters:¶
- from_driver=name
-
Input driver nameOptions: pg,dbf,ogr,odbc,mysql,sqliteDefault: dbf
- from_database=name
-
Input database nameDefault: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
- from_table=name
-
Input table name (only, if 'select' is not used)
- to_driver=name
-
Output driver nameOptions: pg,dbf,ogr,odbc,mysql,sqliteDefault: dbf
- to_database=name
-
Output database nameDefault: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
- to_table=name
-
Output table name
- where=sql_query
-
WHERE conditions of SQL statement without 'where' keywordExample: income = 10000
- select=string
-
Full select statement (only, if 'from_table' and 'where' is not used)E.g.: SELECT dedek FROM starobince WHERE obec = 'Frimburg'
DESCRIPTION¶
db.copy allows the user to copy a table between two databases. Databases can be connected through different drivers (see example).NOTES¶
Attribute tables can be copied manually using db.copy and v.db.connect. Current connection settings are saved in $LOCATION/vector_map/dbln.EXAMPLES¶
DBF -> PG¶
Storing table 'markveggy.dbf' (in current directory) into PostgreSQL through ODBC:from_table=markveggy to_driver=pg to_database="host=pgserver,dbname=grass6test" \
to_table=markveggy
PG -> DBF¶
from_table=origtable to_driver=dbf \
to_database=$HOME/grassdata/spearfish60/user1/dbf to_table=origtable
PG -> PG with condition¶
from_table=ukraine to_driver=pg to_database="host=localhost,dbname=meteo" \
to_table=selection where="cat < 500"
DBF -> SQLite¶
from_table=ammprv to_driver=sqlite \
to_database=$HOME/grassdata/spearfish60/user1/sqlite.db to_table=ammprv
SQLite -> DBF¶
from_table=ammprv to_driver=dbf to_database=$HOME/grassdata/spearfish60/user1/dbf \
to_table=ammprv
SEE ALSO¶
v.db.connect, db.drivers, db.login, v.clean, GRASS SQL interfaceAUTHOR¶
Radim Blazek, ITC-irst, Trento, Italy Last changed: $Date: 2011-11-08 10:42:51 +0100 (Tue, 08 Nov 2011) $ Full index © 2003-2011 GRASS Development Team| GRASS 6.4.2 |