Closed lidiabressan closed 4 years ago
seems not initialized DB try to use dbadb wipe --dsn= or --wipe-first dbadb option on a new db
Done that. It is an other problem.
[mare_exp@maialtest Verifica]$ dbadb wipe --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$ dbadb export year=2017 --dsn=sqlite:Onde/db_vecmaree_onde_2015_2018.parzpuliti.sqlite3 |dbadb import --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$ dbadb dump --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$
expected results?
i dati del 2017 in prova.sqlite
The problem is in the data selection, without year=2018 works. Is there an example somewhere of how to do the selection?
From the --help: Usage: dbadb export [options] rep_memo [queryparm1=val1 [queryparm2=val2 [...]]]
$ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 2014-12-30 2019-01-01 $ $ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 year=2018 | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 None None
$ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 year=2018 rep_memo=vecmaree | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 None None
In one of the options I tried, something happened. I have a new error trying to wipe the sqlite??
$ dbadb wipe --dsn=sqlite:ciao.sqlite3 executing DROP TABLE IF EXISTS repinfo:FOREIGN KEY constraint failed
without year=2018 works.
Ok,this might be related to #173
Try to explicit all date parameters (month
, day
, hour
min
and sec
, see https://arpa-simc.github.io/dballe/parms.html)
thanks, it works!
Can this issue be closed?
Before closing, can you before please clarify one thing in the documentation?
dbadb export --help Usage: dbadb export [options] rep_memo [queryparm1=val1 [queryparm2=val2 [...]]]
I think "rep_memo" in the help is a database. Or do you need to specify rep_memo (which is report now, or maybe network) in the command?
Oops, good catch! That's a mistake in the command line summary. It should be like this instead, and I've now fixed it:
dbadb export --help
Usage: dbadb export [options] [queryparm1=val1 [queryparm2=val2 [...]]]
The database is specified with --url
or with the DBA_DB
environment variable.
Please, add also the last line in the help.
Good idea!
ciao, I cannot find any more the documentation for dbadb. Some example on how to use dbadb could be useful (in addition to dbadb wipe).
In any case, this doesn't work any more, for some unknown reason (version 8.2-1.el7).
A second try leaves prova.sqlite totally empty.
Someone can help? Please, add the answer in the documentation too, for next time reference. Thanks Lidia