/usr/share/doc/grass-doc/html/db.copy.html is in grass-doc 6.4.3-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS manual: db.copy</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">
<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>
<h2>NAME</h2>
<em><b>db.copy</b></em> - Copy a table.<BR>
Either 'from_table' (optionally with 'where') can be used or 'select' option, but not 'from_table' and 'select' at the same time.
<h2>KEYWORDS</h2>
database, attribute table, SQL
<h2>SYNOPSIS</h2>
<b>db.copy</b><br>
<b>db.copy help</b><br>
<b>db.copy</b> [<b>from_driver</b>=<em>name</em>] [<b>from_database</b>=<em>name</em>] [<b>from_table</b>=<em>name</em>] [<b>to_driver</b>=<em>name</em>] [<b>to_database</b>=<em>name</em>] <b>to_table</b>=<em>name</em> [<b>where</b>=<em>sql_query</em>] [<b>select</b>=<em>string</em>] [--<b>overwrite</b>] [--<b>verbose</b>] [--<b>quiet</b>]
<h3>Flags:</h3>
<DL>
<DT><b>--overwrite</b></DT>
<DD>Allow output files to overwrite existing files</DD>
<DT><b>--verbose</b></DT>
<DD>Verbose module output</DD>
<DT><b>--quiet</b></DT>
<DD>Quiet module output</DD>
</DL>
<h3>Parameters:</h3>
<DL>
<DT><b>from_driver</b>=<em>name</em></DT>
<DD>Input driver name</DD>
<DD>Options: <em>sqlite,mysql,odbc,pg,dbf,ogr</em></DD>
<DD>Default: <em>dbf</em></DD>
<DT><b>from_database</b>=<em>name</em></DT>
<DD>Input database name</DD>
<DD>Default: <em>$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/</em></DD>
<DT><b>from_table</b>=<em>name</em></DT>
<DD>Input table name (only, if 'select' is not used)</DD>
<DT><b>to_driver</b>=<em>name</em></DT>
<DD>Output driver name</DD>
<DD>Options: <em>sqlite,mysql,odbc,pg,dbf,ogr</em></DD>
<DD>Default: <em>dbf</em></DD>
<DT><b>to_database</b>=<em>name</em></DT>
<DD>Output database name</DD>
<DD>Default: <em>$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/</em></DD>
<DT><b>to_table</b>=<em>name</em></DT>
<DD>Output table name</DD>
<DT><b>where</b>=<em>sql_query</em></DT>
<DD>WHERE conditions of SQL statement without 'where' keyword</DD>
<DD>Example: income < 1000 and inhab >= 10000</DD>
<DT><b>select</b>=<em>string</em></DT>
<DD>Full select statement (only, if 'from_table' and 'where' is not used)</DD>
<DD>E.g.: SELECT dedek FROM starobince WHERE obec = 'Frimburg'</DD>
</DL>
<h2>DESCRIPTION</h2>
<em>db.copy</em> allows the user to copy a table between two databases.
Databases can be connected through different drivers (see example).
<h2>NOTES</h2>
Attribute tables can be copied using <em>db.copy</em> and, when to be
associated to a vector map, assigned to the map with
<em><a href="v.db.connect.html">v.db.connect</a></em>. Current connection
settings are saved in the file <em>$LOCATION/vector_map/dbln</em>.
<h2>EXAMPLES</h2>
<h3>DBF -> PG</h3>
<em>Storing table 'markveggy.dbf' (in current directory) into PostgreSQL
through ODBC:</em><br>
<div class="code"><pre>
db.copy from_driver=dbf from_database=$HOME/grassdata/spearfish60/user1/dbf \
from_table=markveggy to_driver=pg to_database="host=pgserver,dbname=grass6test" \
to_table=markveggy
</pre></div>
<h3>PG -> DBF</h3>
<div class="code"><pre>
db.copy from_driver=pg from_database="host=pgserver.itc.it,dbname=testdb" \
from_table=origtable to_driver=dbf \
to_database=$HOME/grassdata/spearfish60/user1/dbf to_table=origtable
</pre></div>
<h3>PG -> PG with condition</h3>
<div class="code"><pre>
db.copy from_driver=pg from_database="host=localhost,dbname=meteo" \
from_table=ukraine to_driver=pg to_database="host=localhost,dbname=meteo" \
to_table=selection where="cat < 500"
</pre></div>
<h3>DBF -> SQLite</h3>
<div class="code"><pre>
db.copy from_driver=dbf from_database=$HOME/grassdata/spearfish60/user1/dbf \
from_table=ammprv to_driver=sqlite \
to_database=$HOME/grassdata/spearfish60/user1/sqlite.db to_table=ammprv
# convenient viewer:
sqlitebrowser $HOME/grassdata/spearfish60/user1/sqlite.db
</pre></div>
<h3>SQLite -> DBF</h3>
<div class="code"><pre>
db.copy from_driver=sqlite from_database=$HOME/grassdata/spearfish60/user1/sqlite.db \
from_table=ammprv to_driver=dbf to_database=$HOME/grassdata/spearfish60/user1/dbf \
to_table=ammprv
</pre></div>
<h2>SEE ALSO</h2>
<em><a href="v.db.connect.html">v.db.connect</a>,
<a href="db.drivers.html">db.drivers</a>,
<a href="db.login.html">db.login</a>,
<a href="v.clean.html">v.clean</a>,
<a href="sql.html">GRASS SQL interface</a></em>
<h2>AUTHOR</h2>
Radim Blazek, ITC-irst, Trento, Italy
<p>
<i>Last changed: $Date: 2013-03-18 10:51:35 -0700 (Mon, 18 Mar 2013) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="database.html">database index</a> - <a href="full_index.html">Full index</a></P>
<P>© 2003-2013 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>
|