[GRASS-SVN] r36730 - in grass/branches/develbranch_6/db: . drivers/dbf drivers/sqlite

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 14 15:25:01 EDT 2009


Author: neteler
Date: 2009-04-14 15:25:01 -0400 (Tue, 14 Apr 2009)
New Revision: 36730

Modified:
   grass/branches/develbranch_6/db/databaseintro.html
   grass/branches/develbranch_6/db/drivers/dbf/grass-dbf.html
   grass/branches/develbranch_6/db/drivers/sqlite/grass-sqlite.html
Log:
better explain what the DBF driver isn't doing; explain table migration; cosmetics

Modified: grass/branches/develbranch_6/db/databaseintro.html
===================================================================
--- grass/branches/develbranch_6/db/databaseintro.html	2009-04-14 19:24:30 UTC (rev 36729)
+++ grass/branches/develbranch_6/db/databaseintro.html	2009-04-14 19:25:01 UTC (rev 36730)
@@ -88,9 +88,7 @@
 To drop a column from a selected attribute table, use <a href="db.dropcol.html">db.dropcol</a>.
 With <a href="db.droptable.html">db.droptable</a> an attribute table can be deleted.
 
-
 <h3>Database Schema</h3>
-
 Currently schema support only works for PostgreSQL connections. Default schema
 can be set with <a href="db.connect.html">db.connect</a>. Note that the default 
 schema will be used by all db.* modules.
@@ -98,7 +96,15 @@
 <a href="db.tables.html">db.tables</a> returns 'schema.table' if schemas are
 available in the database.
 
+<h3>Migrating to a different database engine</h3>
 
+To migrate a GRASS database table (or a GRASS vector map) to a different DBMI engine,
+the best solution is to create a new MAPSET, define the DBMI settings accordingly
+with <a href="db.connect.html">db.connect</a> and if needed, <a href="db.login.html">db.login</a>.
+Then the table of interest can be copied over with <a href="db.copy.html">db.copy</a> from
+the original MAPSET. Likewise, a vector map including its table(s) are copied from
+the original MAPSET to the current MAPSET with <a href="g.copy.html">g.copy</a>.
+
 <h3>See also</h3>
 
 <ul>

Modified: grass/branches/develbranch_6/db/drivers/dbf/grass-dbf.html
===================================================================
--- grass/branches/develbranch_6/db/drivers/dbf/grass-dbf.html	2009-04-14 19:24:30 UTC (rev 36729)
+++ grass/branches/develbranch_6/db/drivers/dbf/grass-dbf.html	2009-04-14 19:25:01 UTC (rev 36730)
@@ -12,7 +12,7 @@
 
 <h1>DBF driver in GRASS</h1>
 
-<H2>Defining the DBF driver</H2>
+<h2>Defining the DBF driver</h2>
 
 The DBF driver is the default driver, in theory no user interaction is
 required. However, if the settings should be set back from a different
@@ -26,8 +26,9 @@
 
 The dbf/ subdirectory in the mapset must exist or must be created by the user.
 
-<H2>Creating a DBF table</H2>
 
+<h2>Creating a DBF table</h2>
+
 Usually DBF tables are created by GRASS when generating a vector map
 with attributes (and using DBF as default attribute driver).
 <p>
@@ -36,7 +37,9 @@
 is sometimes useful as well as <a href="db.in.ogr.html">db.in.ogr</a> to import external
 tables.
 
-<H2>Supported SQL commands by DBF driver</H2>
+
+<h2>Supported SQL commands by DBF driver</h2>
+
 <div class="code"><pre>
   ALTER TABLE table ADD [COLUMN] columndef
   ALTER TABLE table DROP COLUMN colname
@@ -53,7 +56,9 @@
   UPDATE table SET assignment1[,assignment2,...] WHERE condition
 </pre></div>
 
-<H2>Operators available in conditions</H2>
+
+<h2>Operators available in conditions</h2>
+
 <div class="code"><pre>
   "="  : equal
   "&lt;"  : smaller than
@@ -65,30 +70,57 @@
   "%"  : Substring matching  (limited functionality)
 </pre></div>
 
-<p> Arithmetic expressions using constants and field values are allowed 
-in condition clauses and in the RHS of assignments. 
+<p>
+Arithmetic expressions using constants and field values are allowed 
+in condition clauses and in the RHS of assignments.
+<br>
 Usual precedence rules and bracketing (using '(' and ')') are supported. 
-Type conversion is performed if necessary (experimental). </p>
+<br>
+Type conversion is performed if necessary (experimental). 
 
-<p> Aggregate functions (sum, count, min, max,...) are NOT currently supported 
-    in SELECT clauses. </p>
+<p>
+Conditions allow boolean expressions using the AND, OR and NOT operators, 
+with the usual precedence rules. 
 
-<p> Mathematic functions (sin, cos, exp, log,...) are NOT currently supported 
-    in expressions. </p>
+<p>
+NULLs can be tested by 'colname IS NULL' in conditions. The negation is
+'colname NOT NULL'.
 
-<p> Conditions allow boolean expressions using the AND, OR and NOT operators, 
-    with the usual precedence rules. </p>
+<p>
+Sorting: Empty fields in a character column are sorted to the end.
 
-<p> NULLs can be tested by 'colname IS NULL' in conditions. The negation is 'colname NOT NULL'.</p>
 
-<p> Sorting: Empty fields in a character column are sorted to the end.</p>
+<h2>LIMITATIONS OF THE DBF DRIVER</h2>
 
+The DBF driver supports only a <b>few SQL statements</b> since the DBF tables are
+intended for simple table storage. DBF column names are limited to 10 characters
+(as defined in the DBF specifications). For example,
+
+<ul>
+<li> aggregate functions (sum, count, min, max,...) are <b>not</b> supported 
+in SELECT clauses;</li>
+<li> mathematic functions (sin, cos, exp, log,...) are <b>not</b> supported 
+in expressions;</li>
+<li> SQL query with IN are <b>not</b> supported.</li>
+</ul>
+
 <h2>ERROR MESSAGES</h2>
 
 An error message such as:
 
 <div class="code"><pre>
 DBMI-DBF driver error:
+SQL parser error: syntax error, unexpected NAME processing 'IN'..
+</pre></div>
+indicates that an unsupported SQL statement (here, 'IN') was used. The only
+solution is to switch the DBMI backend to a real SQL engine (SQLite, 
+PostgreSQL, MySQL etc.). See <a HREF="sql.html">SQL support in GRASS GIS</a>.
+
+<p>
+An error message such as:
+
+<div class="code"><pre>
+DBMI-DBF driver error:
 SQL parser error: syntax error, unexpected DESC, expecting NAME processing 'DESC'
 </pre></div>
 
@@ -106,6 +138,7 @@
 </em>
 
 <p><i>Last changed: $Date$</i>
+
 <HR>
 <BR><a href=index.html>Help Index</a>
 </body>

Modified: grass/branches/develbranch_6/db/drivers/sqlite/grass-sqlite.html
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/grass-sqlite.html	2009-04-14 19:24:30 UTC (rev 36729)
+++ grass/branches/develbranch_6/db/drivers/sqlite/grass-sqlite.html	2009-04-14 19:25:01 UTC (rev 36730)
@@ -35,7 +35,8 @@
 
 All SQL commands supported by SQLite (for limitations, see
 SQLite help page:
-<a href="http://www.sqlite.org/lang_expr.html">SQL As Understood By SQLite</a>).
+<a href="http://www.sqlite.org/lang.html">SQL As Understood By SQLite</a> and
+<a href="http://www.sqlite.org/omitted.html">Unsupported SQL</a>).
 
 
 <H2>Operators available in conditions</H2>
@@ -56,6 +57,7 @@
 </pre></div>
 
 <!-- doesnt work yet, why?:
+  ah, pending patch: http://www.sqlite.org/cvstrac/tktview?tn=1476
 
 <H2>Adding an unique ID column</H2>
 



More information about the grass-commit mailing list