EnglishFrenchSpanish

Ad


OnWorks favicon

db.selectgrass - Online in the Cloud

Run db.selectgrass in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command db.selectgrass that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


db.select - Selects data from attribute table.
Performs SQL query statement(s).

KEYWORDS


database, attribute table, SQL

SYNOPSIS


db.select
db.select --help
db.select [-cdvt] [sql=sql_query] [input=name] [table=name] [driver=name]
[database=name] [separator=character] [vertical_separator=character]
[null_value=string] [output=name] [--overwrite] [--help] [--verbose] [--quiet]
[--ui]

Flags:
-c
Do not include column names in output

-d
Describe query only (don’t run it)

-v
Vertical output (instead of horizontal)

-t
Only test query, do not execute

--overwrite
Allow output files to overwrite existing files

--help
Print usage summary

--verbose
Verbose module output

--quiet
Quiet module output

--ui
Force launching GUI dialog

Parameters:
sql=sql_query
SQL select statement
For example: ’select * from rybniky where kapri = ’hodne’

input=name
Name of file containing SQL select statement(s)
’-’ for standard input

table=name
Name of table to query

driver=name
Name of database driver
Options: mysql, odbc, sqlite, pg, ogr, dbf
Default: sqlite

database=name
Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

separator=character
Field separator
Special characters: pipe, comma, space, tab, newline
Default: pipe

vertical_separator=character
Vertical record separator (requires -v flag)
Special characters: pipe, comma, space, tab, newline

null_value=string
String representing NULL value

output=name
Name for output file (if omitted or "-" output to stdout)

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 specified each time. Output will be displayed to
standard output or can be directed to a file (option output).

EXAMPLES


Basic usage
db.select sql="select * from roads"
or
echo "select * from roads" | db.select input=-
or
db.select input=file.sql
or
cat file.sql | db.select input=-

Select all from table roads:
db.select -c driver=odbc database=mydb table=hospitals \
input=file.sql output=result.csv

Select some string attribute, exclude others:
db.select sql="SELECT * FROM archsites WHERE str1 <> ’No Name’"

Select some string attribute with ZERO length:
db.select sql="SELECT * FROM archsites WHERE str1 IS NULL"

Select coordinates from PostGIS table:
db.select sql="SELECT x(geo),y(geo) FROM localizzazione"

Execute multiple SQL statements
cat file.sql
SELECT * FROM busstopsall WHERE cat = 1
SELECT cat FROM busstopsall WHERE cat > 4 AND cat < 8
db.select input=file.sql

Count number of cases falling into same position
When multiple observation have the spatial coordinates, they can still be counted (if
needed, coordinates can be uploaded to the attribute table by v.to.db:
db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases \
FROM diseases GROUP BY long,lat"

Use db.selectgrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    MSYS2
    MSYS2
    MSYS2 is a collection of tools and
    libraries providing you with an
    easy-to-use environment for building,
    installing and running native Windows
    software. It con...
    Download MSYS2
  • 2
    DOSBox
    DOSBox
    DOSBox emulates a full x86 pc with
    sound and DOS. Its main use is to run
    old DOS games on platforms which
    don't have DOS (Windows 7, 8, 8.1
    and 10 / Linux ...
    Download DOSBox
  • 3
    Xtreme Download Manager
    Xtreme Download Manager
    The project has a new home now:
    https://xtremedownloadmanager.com/ For
    developers:
    https://github.com/subhra74/xdm Xtreme
    Download Manager is a powerful tool t...
    Download Xtreme Download Manager
  • 4
    Clover EFI bootloader
    Clover EFI bootloader
    Project has moved to
    https://github.com/CloverHackyColor/CloverBootloader..
    Features:Boot macOS, Windows, and Linux
    in UEFI or legacy mode on Mac or PC with
    UE...
    Download Clover EFI bootloader
  • 5
    Sequelize
    Sequelize
    Sequelize is a promise-based Node.js
    ORM for Postgres, MySQL, MariaDB, SQLite
    and Microsoft SQL Server. It features
    solid transaction support, relations,
    eager...
    Download Sequelize
  • 6
    unitedrpms
    unitedrpms
    Join us in Gitter!
    https://gitter.im/unitedrpms-people/Lobby
    Enable the URPMS repository in your
    system -
    https://github.com/UnitedRPMs/unitedrpms.github.io/bl...
    Download unitedrpms
  • 7
    Boost C++ Libraries
    Boost C++ Libraries
    Boost provides free portable
    peer-reviewed C++ libraries. The
    emphasis is on portable libraries which
    work well with the C++ Standard Library.
    See http://www.bo...
    Download Boost C++ Libraries
  • More »

Linux commands

Ad