Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-03 Thread Steffen Mangold
Hi Simon, thanks for your help. All worked now :) I only lost some data at the end of the table, not so bad. Thank you :) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 10:45pm, Steffen Mangold wrote: > I now delete the malform message and the rollback command from the *.sql file > and run ".read". Okay ... > Sqlite shell runs complete and the shell ask me for new command "> " (DB file > seems to have the right size. > I'm happy now and en

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/03/12 15:32, Steffen Mangold wrote: > how to "replace" this? Change the abort to commit as others pointed out. The dump code does the following: print BEGIN foreach table in the database: foreach row in the table: print the row print C

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > You should be able to, yes. Just type in "END;" (without quotes, but with > semicolon). > Ok thank you i will try :) (in a few hours because DB is so big. :) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailm

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
Hi roger, > > What you don't seem to understand is that your original database is corrupt. > The data that is in it is not exactly what SQLite (and hence your program) > put in it. While doing the dump, the corruption was discovered and the dump > aborted. You just replaced the abort > > com

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/03/12 14:45, Steffen Mangold wrote: > I'm happy now and enter command ".exit" and bam Db file has 0kb?!?!? > What have i done wrong? Any Commit command or something? What you don't seem to understand is that your original database is corrupt.

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Igor Tandetnik
On 3/2/2012 5:57 PM, Steffen Mangold wrote: If you have a BEGIN command in your script, then you should also have END or COMMIT at the end (the two are synonyms). can i do this by shell command after ".read" if my SQL script has miss that? You should be able to, yes. Just type in "END;" (w

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > If you have a BEGIN command in your script, then you should also have END or > COMMIT at the end (the two are synonyms). > can i do this by shell command after ".read" if my SQL script has miss that? Steffen ___ sqlite-users mailing list sqlite-use

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Igor Tandetnik
On 3/2/2012 5:45 PM, Steffen Mangold wrote: WHAT THE ! I now delete the malform message and the rollback command from the *.sql file and run ".read". Sqlite shell runs complete and the shell ask me for new command "> " (DB file seems to have the right size. I'm happy now and enter comman

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
WHAT THE ! I now delete the malform message and the rollback command from the *.sql file and run ".read". Sqlite shell runs complete and the shell ask me for new command "> " (DB file seems to have the right size. I'm happy now and enter command ".exit" and bam Db file has 0kb?!?!? What hav

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 7:08pm, Steffen Mangold wrote: > Ok maybe i found it in the sql file is written (file end): > > [...] > INSERT INTO "InverterData" VALUES(2478,'2012-02-28 > 15:00:00',1435.73,429173.78,170.28,170.75,169.38,397.56,397.38,396.69,NULL,210976,31,NULL,NULL,1,304,NULL,NULL,NULL,694

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
Ok maybe i found it in the sql file is written (file end): [...] INSERT INTO "InverterData" VALUES(2478,'2012-02-28 15:00:00',1435.73,429173.78,170.28,170.75,169.38,397.56,397.38,396.69,NULL,210976,31,NULL,NULL,1,304,NULL,NULL,NULL,694,NULL,NULL,NULL); / ERROR: (11) database disk image is mal

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > Is it very long ? Can you read it with a dump utility or a text editor > (don't try it with a word processor) and see the SQL commands in it ? > Yes 14 GB. 4 Table, roundabout 200.000.000 inserts. I opened it with a textviewer for large files. Sql seams well formed and readable till the en

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 6:30pm, Steffen Mangold wrote: >> Are you saying it creates a database file but doesn't put anything into it >> (zero filesize) or that it doesn't even create a blank file ? > > With dump its write the complete DB File new but nearly at the end (new DD > file size compared t

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > Are you saying it creates a database file but doesn't put anything into it > (zero filesize) or that it doesn't even create a blank file ? > With dump its write the complete DB File new but nearly at the end (new DD file size compared to the malformed) Sqlite shell breaks and set the file siz

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 6:16pm, Steffen Mangold wrote: >> There's no magic tool for repairing damaged database files. But by using >> the .dump command (if necessary on each individual table and view) then >> creating a new database file and using the .read command you can often >> rescue some or

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > Ok, with .dumb i now created a "db.sql" file successfully. > but I don't get the read command!? How create a new DB file with that command? > With "sqlite> .read db.sql" it does much reading but no file is created. > Ok I get it, must attach a DB first. now sqlite writes the data to the DB, h

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > There's no magic tool for repairing damaged database files. But by using the > .dump command (if necessary on each individual table and view) then creating > a new database file and using the .read command you can often rescue some or > all of the data in the original > > database. > Ok, w

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 2:36pm, Steffen Mangold wrote: > I read in some forums that .dumb is the best way to repair "malformed" DBs. > Do you have an other way? It doesn't repair anything. And the .dump command may, or may not, work on a malformed database file. It depends on what'sw wrong with t

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
> > First, get all the other databases done, so you're worried only about the one > which doesn't work. > > Then do the .dump part for that database, putting the output into a file on > disk, which should leave you with a huge file of SQL commands which should > rebuild it. > > It's likely that

Re: [sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Simon Slavin
On 2 Mar 2012, at 1:20pm, Steffen Mangold wrote: > i have a problem with the sqlite2.exe under windows. > Ok, I have here 20 corrupted DBs and want to repair they all. > I do this with CMD and the command ".dump | sqlite3 rebuild.db3 | sqlite3 > rebuild.temp" > > This works perfect for all DBs

[sqlite] Sqlite3 command shell dump possible bug

2012-03-02 Thread Steffen Mangold
Hi guys, i have a problem with the sqlite2.exe under windows. Ok, I have here 20 corrupted DBs and want to repair they all. I do this with CMD and the command ".dump | sqlite3 rebuild.db3 | sqlite3 rebuild.temp" This works perfect for all DBs except one. The DB where it is not working has a size