db.select.1grass

Langue: en

Version: 313040 (ubuntu - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

db.select

DESCRIPTION

db.select prints result of selection from database based on SQL statement read from input file or from standard input to standard output.

NOTE

If parameters for database connection are already set with db.connect, they are taken as default values and do not need to be spcified each time. Output will be displayed to stdout or can be directed to a file.

EXAMPLES


echo "select * from roads" | db.select
or

 cat file.sql | db.select 
or

 db.select input=file.sql

Select all from table roads

db.select -c driver=odbc database=g51test table=roads input=file.sql > result.csv

Select some string attribute, exclude others:

echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select

Select some string attribute with ZERO length:

echo "SELECT * FROM archsites WHERE str1 IS NULL" | db.select

Select coordinates from PostGIS table:

echo "SELECT x(geo),y(geo) FROM localizzazione" | db.select

SEE ALSO

GRASS SQL interface, db.connect, db.describe, db.drivers, db.droptable, db.execute, db.login, db.tables

AUTHOR

?
Modifications: Radim Blazek, ITC-Irst, Trento, Italy

Last changed: $Date: 2006/09/21 06:14:49 $

Full index