Re: [sqlite] ATTACH DATABASE question

2012-09-27 Thread Igor Tandetnik
john_prov...@yahoo.com wrote: > I’m confused about how to attach a database file to an existing database. I > open my main database ok, then to attach the second > database, I try to execute the following SQL: > > ATTACH DATABASE ‘c:\mydata\my_attach_database.db’ AS ‘attached_db’ > > Calling

[sqlite] ATTACH DATABASE question

2012-09-27 Thread john_provine
I’m confused about how to attach a database file to an existing database. I open my main database ok, then to attach the second database, I try to execute the following SQL: ATTACH DATABASE ‘c:\mydata\my_attach_database.db’ AS ‘attached_db’ Calling “SQLite3_Prepare_v2” on this statement

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-27 Thread Christopher Vance
On 28 September 2012 03:08, David Barrett wrote: > Also, I disagree its a "standard, time tested" solution. I've never even > heard of this trick before, and despite its passionate defense, I'd > encourage everybody (including the SQLite maintainers) to stop using it. I

Re: [sqlite] [ANN] SQLiteDoctor

2012-09-27 Thread Bogdan Ureche
Not sure about OS X, but definitely not the only way on Windows. Bogdan Ureche http://www.sqliteexpert.com On Thu, Sep 27, 2012 at 7:58 AM, Marco Bambini wrote: > Announcing SQLiteDoctor, the only way to recover your corrupted

Re: [sqlite] interesting deadlock.

2012-09-27 Thread Jonathan Engle
I've been picking away at this for the last few days and have it narrowed down fairly well. It looks like if I turn off shared cache, it works fine (same application code). If I run with SQL_DEBUG enabled, the first issue I run into in an assertion in sqlite3BtreeEnter: assert(

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-27 Thread David Barrett
Incidentally, I agree with Simon. It exchanges the extremely easy problem of temp namespace collision for the very hard problem of invisible files filling up your hard drive. Indeed, it was diagnosing this hard problem -- at great cost in time and confusion -- that caused us to discover it in

Re: [sqlite] database disk image is malformed - Error

2012-09-27 Thread David Barrett
In my experience, retrying does often work. -david On Tue, Sep 25, 2012 at 7:31 PM, Rittick Gupta wrote: > Do you think a retry of the query would help resolve this issue ? Do I > have to close & reopen the database. > > Thanks for your help. > > regards, > > Rittick >

Re: [sqlite] .mode tabs does not work

2012-09-27 Thread Clemens Ladisch
hpydktvjnksya kfoxwfswkhlhuk wrote: > 1. ".mode tabs" works strange: > > echo -e ".show\n.mode tabs\n.show" | sqlite3 | grep mode > mode: list > mode: list That's how it works. > 2. "separator" changes to "\t", but cannot .import files with "\"": > > echo -ne "\"\t" >f && sqlite3 <

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
The other thing you should do is check the exit status of sqlite3. if not 0 then an error occurred. Plus parse the output to see if you get any errors -- in specific handle the errors you know about and show errors that need a handler. So for BUSY and LOCKED you may loop for a while retrying

Re: [sqlite] EXT :Re: Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
I am using 3.6.12 . Let me upgrade and try again. On Thu, Sep 27, 2012 at 10:33 AM, Black, Michael (IS) < michael.bla...@ngc.com> wrote: > I should note I'm using 3.7.13 > > -cmd wasn't in there back in 3.7.4 -- not sure when it shows up. > > You may need to upgrade. > > Michael D. Black >

Re: [sqlite] EXT :Re: Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
I should note I'm using 3.7.13 -cmd wasn't in there back in 3.7.4 -- not sure when it shows up. You may need to upgrade. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] EXT :Re: Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
This works for me just from a shell prompt. Can you test from your shell? I had a table thusly created in test.db create table t(a); insert into t values('test1'); insert into t values('test2'); sqlite3 -cmd ".timeout 2000" test.db "select * from t;" test1 test2 Michael D. Black Senior

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
After testing both commands I get the following error: error "sqlite3: unknown option: -cmd Use -help for a list of options." number 1 On Thu, Sep 27, 2012 at 10:07 AM, Black, Michael (IS) < michael.bla...@ngc.com> wrote: > The command does need to be in quotes if it's more than one word.

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
As you can tell, I don't have much experience with sql. I was going in the timeout direction because simply resending the command several seconds after the locked error occurred seemed to return the correct value. My plan is to implement Michael's suggestion and if the error continues to occur,

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
The command does need to be in quotes if it's more than one word. sqilte3 expects 1 argument for the command. I'm not familiar with applescript but I assume you have to escape quotes to make them actually appear in the output. Michael D. Black Senior Scientist Advanced Analytics Directorate

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Jay A. Kreibich
On Thu, Sep 27, 2012 at 09:39:31AM -0400, John scratched on the wall: > Thank you Michael. I can't find anything in the documentation about the > -cmd switch. Will you point me in the right direction? Also, a 2 second > timeout would be .timeout 2000 , right? Do understand that this will not

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
I can't find anything about the -cmd switch outside of the official docs either! Does the command need to be escaped as it is in your example set xxx to do shell script "sqlite3 -cmd \".timeout 2\" " & databasePath & " \"select * from "& table1 & ";\"" or can I simply use ? set xxx to do shell

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
sqlite3 -help The sqlite3 shell page doesn't explain any switches...couldn't find another page about it. Anybody??? And you're right on timeout -- it's in milliseconds. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman

Re: [sqlite] DELETE Query Assistance Please

2012-09-27 Thread Don Goyette
Thank you all for your suggestions. I've created a set of manual steps to create the 1000 table delete query that only took me 10 minutes to accomplish. A whole lot simpler than trying to figure out how to automate this entire 1000 table process in SQLite. -Don

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
Thank you Michael. I can't find anything in the documentation about the -cmd switch. Will you point me in the right direction? Also, a 2 second timeout would be .timeout 2000 , right? John On Thu, Sep 27, 2012 at 8:36 AM, Black, Michael (IS) wrote: > Try the -cmd

[sqlite] [ANN] SQLiteDoctor

2012-09-27 Thread Marco Bambini
Announcing SQLiteDoctor, the only way to recover your corrupted sqlite databases. Details available from: http://www.sqlabs.com/sqlitedoctor.php -- Marco Bambini http://www.sqlabs.com ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Black, Michael (IS)
Try the -cmd switch. Probably the easiest solution. set xxx to do shell script "sqlite3 -cmd \".timeout 2\" " & databasePath & " \"select * from "& table1 & ";\"" Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman

[sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
Hi, I have several different computers running an AppleScript that queries and writes to a SQLite3 database located in a shared folder on the network. Occasionally a "database is locked" error is produced. Is there a way of sending a .timeout command as if I was working from the shell, in

[sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread John
Hi, I have several different computers running an AppleScript that queries and writes to a SQLite3 database located in a shared folder on the network. Occasionally a "database is locked" error is produced. Is there a way of sending a .timeout command as if I was working from the shell, in

Re: [sqlite] .mode tabs does not work

2012-09-27 Thread hpydktvjnksya kfoxwfswkhlhuk
Wed, 26 Sep 2012 14:59:57 +0200 Clemens Ladisch wrote: >somebody wrote: >> .mode tabs does not work: >> >> sqlite3 <> .mode tabs >> .show >> EOF >> ... >> separator: "\t" > >Obviously, it does work. > >> echo -ne "\"\t" >f && sqlite3 <> create table t(a text, b text); >>

Re: [sqlite] Seemingly random Access Violation errors

2012-09-27 Thread Matthew Dumbleton
Ok. Will try and write a simpler version to pass on to you asap. From: Joe Mistachkin Sent: 26/09/2012 23:47 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Seemingly random Access Violation errors Matthew Dumbleton wrote: > > Sorry, should have