db.columns - List all columns for a given table.
Contents
Description
db.columns lists all columns for a give table. Connection to databases are supported through dbf, shp,
odbc and pg drivers.
Examples
ListcolumnsofaPostgreSQLattributetable
db.columns table=zipcodes_wake driver=pg database=grassdb
Ifthedatabaseparametersarealreadyset,thecolumnscanbelisteddirectly
db.columns table=zipcodes_wake
ListcolumnsfromShapefilewithDBFattributetable
db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/
ListcolumnsoftableinSQLitedatabase
Note that the SQLite backend is the default setting.
db.columns driver=sqlite table=archsites database=’$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db’
Keywords
database, attribute table
Name
db.columns - List all columns for a given table.
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.
See Also
db.connect,db.describe,db.drivers,db.droptable,db.execute,db.login,db.tables,GRASSSQLinterface
GRASS SQL interface
Source Code
Available at: db.columns source code (history)
Accessed: Friday Apr 04 01:18:42 2025
Main index | Database index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
GRASS 8.4.1 db.columns(1grass)
Synopsis
db.columnsdb.columns--helpdb.columnstable=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: dbf,mysql,odbc,ogr,pg,sqlite
Default: sqlitedatabase=name
Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db