[GRASS-dev] [GRASS GIS] #3397: db.select - reading multiline SQL statements from file fails
GRASS GIS
trac at osgeo.org
Fri Aug 11 03:21:23 PDT 2017
#3397: db.select - reading multiline SQL statements from file fails
--------------------------+-----------------------------------
Reporter: maitl | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.4.0
Component: Database | Version: 7.2.1
Resolution: | Keywords: db.select, db.execute
CPU: Unspecified | Platform: All
--------------------------+-----------------------------------
Comment (by mlennert):
Replying to [comment:2 mlennert]:
> and I cannot integrate a newline ('\n') character:
>
> {{{
> echo "SELECT count(*) FROM boundary_county WHERE Z_MEAN > 38\n; SELECT
count(*) FROM boundary_county;" | db.select input=-
> DBMI-SQLite erreur de pilote :
> Error in sqlite3_prepare():
> SELECT count(*) FROM boundary_county WHERE Z_MEAN > 38\n; SELECT
count(*) FROM boundary_county;
> unrecognized token: "\"
> }}}
Sorry, the '\n' was not well placed. It should have been
{{{
echo "SELECT count(*) FROM boundary_county WHERE Z_MEAN > 38;\n SELECT
count(*) FROM boundary_county;" | db.select input=-
database=GRASS/GRASSDATA/NC_spm_temporal_workshop/PERMANENT/sqlite/sqlite.db
count(*)
333
}}}
So, no error, but the query on the second line does not get executed...
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3397#comment:3>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list