db.columns.1grass man page

db.columns — List all columns for a given table.

Keywords

database, attribute table

Synopsis

db.columns
db.columns --help
db.columns table=name [driver=name] [database=name] [--help] [--verbose] [--quiet] [--ui]

Flags

--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters

table=name [required]
Name of attribute table
driver=name
Name of database driver
Options: mesql, pg, dbf, sqlite, odbc, ogr, mysql
Default: sqlite
database=name
Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

Description

db.columns lists all columns for a give table. Connection to databases are supported through dbf, shp, odbc and pg drivers.

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.

Examples

List columns of a PostgreSQL attribute table

db.columns table=zipcodes_wake driver=pg database=grassdb

If the database parameters are already set, the columns can be listed directly

db.columns table=zipcodes_wake

List columns from Shape file with DBF attribute table

db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/

List columns of table in SQLite database

Note that the SQLite backend is the default setting.

db.columns driver=sqlite table=archsites database=’$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db’

See Also

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

GRASS SQL interface

Author

Radim Blazek, ITC-Irst, Trento, Italy

Last changed: $Date: 2014-11-28 10:58:18 +0100 (Fri, 28 Nov 2014) $

Main index | Database index | Topics index | Keywords index | Full index

© 2003-2016 GRASS Development Team, GRASS GIS 7.0.4 Reference Manual

Info

GRASS 7.0.4 Grass User's Manual