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

2012-09-30 Thread Ryan Henrie
I posted this a while ago: 
http://sqlite.1065341.n5.nabble.com/Loading-Options-from-the-command-line-binary-td12230.html 



It's not very obvious.

John wrote:

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
Command-Line Mode? I understand I can write an error handler which will
accomplish the same thing but I am trying to avoid that option.

property databaseFolder : POSIX path of (path to public folder as text) &
"Databases/"
property databaseName : "myDatabase"
property databasePath : quoted form of (databaseFolder & databaseName astext)
property table1 : "Main"

set xxx to do shell script "sqlite3 " & databasePath & " \"select *
from "& table1 & ";
\""

Thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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

2012-09-28 Thread John
I used the following to upgrade SQLite 3 on 10.6.8. I now have version
3.6.12 installed in /usr/bin/ and version 3.7.14 installed in
/usr/local/bin/. Was this the best way to install it?

mkdir ~/tempFolder
cd ~/tempFolder
curl https://www.sqlite.org/sqlite-autoconf-3071400.tar.gz | tar xvz
cd sqlite-autoconf-3071400
autoconf
./configure --prefix=/usr/local
make
sudo make install


As long as I call the latest version, the command below works perfectly.
set xxx to do shell script "/usr/local/bin/sqlite3 -cmd \".timeout 2\"  " &
databasePath & " \"select * from " & table1 & ";\""

Thank you for your help.
John


On Thu, Sep 27, 2012 at 10:49 AM, Black, Michael (IS) <
michael.bla...@ngc.com> wrote:

> 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 it.
>
> Again..don't know how applescript does this.
>
>
> Michael D. Black
> Senior Scientist
> Advanced Analytics Directorate
> Advanced GEOINT Solutions Operating Unit
> Northrop Grumman Information Systems
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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

2012-09-28 Thread Jay A. Kreibich
On Thu, Sep 27, 2012 at 10:15:14AM -0400, John scratched on the wall:
> 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,
> place a rollback in an error handler and move on from there. Is that
> reasonable or am I still missing something?

  That sounds fine.  The main point I was trying to make is that there
  are some (rare) situations when a timeout value will not solve every
  problem, even if the server has very light concurrency needs.  There
  are situations when the handler will still return a SQLITE_BUSY error,
  and you're only choice is to rollback and start over.  The timeout
  should catch and handle the vast, vast majority of SQLITE_BUSY errors,
  however.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 it.

Again..don't know how applescript does this.


Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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.  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
> Advanced GEOINT Solutions Operating Unit
> Northrop Grumman Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of John [sql...@johneday.com]
> Sent: Thursday, September 27, 2012 9:02 AM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in
> Command-Line Mode
>
> 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 script "sqlite3 -cmd .timeout 2 " & databasePath & "
> \"select * from " & table1 & ";\""
>
> Thanks again for revealing the (apparent) -cmd switch secret.
>
>
> On Thu, Sep 27, 2012 at 9:44 AM, Black, Michael (IS) <
> michael.bla...@ngc.com
> > wrote:
>
> > 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 Information Systems
> >
> > 
> > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> > on behalf of John [sql...@johneday.com]
> > Sent: Thursday, September 27, 2012 8:39 AM
> > To: General Discussion of SQLite Database
> > Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in
> > Command-Line Mode
> >
> > 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) <
> > michael.bla...@ngc.com
> > > wrote:
> >
> > > 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 Information Systems
> > >
> > > 
> > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org
> ]
> > > on behalf of John [sql...@johneday.com]
> > > Sent: Thursday, September 27, 2012 7:12 AM
> > > To: sqlite-users
> > > Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line
> > > Mode
> > >
> > > 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
> > > Command-Line Mode? I understand I can write an error handler which will
> > > accomplish the same thing but I am trying to avoid that option.
> > >
> > > property databaseFolder : POSIX path of (path to public folder as
> text) &
> > > "Databases/"
> > > property databaseName : "myDatabase"
> > > property databasePath : quoted form of (databaseFolder & databaseName
> > > astext)
> > > property table1 : "Main"
> > >
> > > set xxx to do shel

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,
place a rollback in an error handler and move on from there. Is that
reasonable or am I still missing something?



On Thu, Sep 27, 2012 at 10:06 AM, Jay A. Kreibich  wrote:

> 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 solve every problem.  Even with a
>   timeout, there are situations when you can still get a locking error
>   and your only choice is to rollback and try again.
>
>-j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it,
>  but showing it to the wrong people has the tendency to make them
>  feel uncomfortable." -- Angela Johnson
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of John [sql...@johneday.com]
Sent: Thursday, September 27, 2012 9:02 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

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 script "sqlite3 -cmd .timeout 2 " & databasePath & "
\"select * from " & table1 & ";\""

Thanks again for revealing the (apparent) -cmd switch secret.


On Thu, Sep 27, 2012 at 9:44 AM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> 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 Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of John [sql...@johneday.com]
> Sent: Thursday, September 27, 2012 8:39 AM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in
> Command-Line Mode
>
> 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) <
> michael.bla...@ngc.com
> > wrote:
>
> > 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 Information Systems
> >
> > 
> > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> > on behalf of John [sql...@johneday.com]
> > Sent: Thursday, September 27, 2012 7:12 AM
> > To: sqlite-users
> > Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line
> > Mode
> >
> > 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
> > Command-Line Mode? I understand I can write an error handler which will
> > accomplish the same thing but I am trying to avoid that option.
> >
> > property databaseFolder : POSIX path of (path to public folder as text) &
> > "Databases/"
> > property databaseName : "myDatabase"
> > property databasePath : quoted form of (databaseFolder & databaseName
> > astext)
> > property table1 : "Main"
> >
> > set xxx to do shell script "sqlite3 " & databasePath & " \"select *
> > from "& table1 & ";
> > \""
> >
> > Thanks.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 solve every problem.  Even with a
  timeout, there are situations when you can still get a locking error
  and your only choice is to rollback and try again.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 script "sqlite3 -cmd .timeout 2 " & databasePath & "
\"select * from " & table1 & ";\""

Thanks again for revealing the (apparent) -cmd switch secret.


On Thu, Sep 27, 2012 at 9:44 AM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> 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 Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of John [sql...@johneday.com]
> Sent: Thursday, September 27, 2012 8:39 AM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in
> Command-Line Mode
>
> 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) <
> michael.bla...@ngc.com
> > wrote:
>
> > 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 Information Systems
> >
> > 
> > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> > on behalf of John [sql...@johneday.com]
> > Sent: Thursday, September 27, 2012 7:12 AM
> > To: sqlite-users
> > Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line
> > Mode
> >
> > 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
> > Command-Line Mode? I understand I can write an error handler which will
> > accomplish the same thing but I am trying to avoid that option.
> >
> > property databaseFolder : POSIX path of (path to public folder as text) &
> > "Databases/"
> > property databaseName : "myDatabase"
> > property databasePath : quoted form of (databaseFolder & databaseName
> > astext)
> > property table1 : "Main"
> >
> > set xxx to do shell script "sqlite3 " & databasePath & " \"select *
> > from "& table1 & ";
> > \""
> >
> > Thanks.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of John [sql...@johneday.com]
Sent: Thursday, September 27, 2012 8:39 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

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) <michael.bla...@ngc.com
> wrote:

> 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 Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of John [sql...@johneday.com]
> Sent: Thursday, September 27, 2012 7:12 AM
> To: sqlite-users
> Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line
> Mode
>
> 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
> Command-Line Mode? I understand I can write an error handler which will
> accomplish the same thing but I am trying to avoid that option.
>
> property databaseFolder : POSIX path of (path to public folder as text) &
> "Databases/"
> property databaseName : "myDatabase"
> property databasePath : quoted form of (databaseFolder & databaseName
> astext)
> property table1 : "Main"
>
> set xxx to do shell script "sqlite3 " & databasePath & " \"select *
> from "& table1 & ";
> \""
>
> Thanks.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 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 Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of John [sql...@johneday.com]
> Sent: Thursday, September 27, 2012 7:12 AM
> To: sqlite-users
> Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line
> Mode
>
> 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
> Command-Line Mode? I understand I can write an error handler which will
> accomplish the same thing but I am trying to avoid that option.
>
> property databaseFolder : POSIX path of (path to public folder as text) &
> "Databases/"
> property databaseName : "myDatabase"
> property databasePath : quoted form of (databaseFolder & databaseName
> astext)
> property table1 : "Main"
>
> set xxx to do shell script "sqlite3 " & databasePath & " \"select *
> from "& table1 & ";
> \""
>
> Thanks.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of John [sql...@johneday.com]
Sent: Thursday, September 27, 2012 7:12 AM
To: sqlite-users
Subject: EXT :[sqlite] Sending SQLite3 .timeout command in Command-Line Mode

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
Command-Line Mode? I understand I can write an error handler which will
accomplish the same thing but I am trying to avoid that option.

property databaseFolder : POSIX path of (path to public folder as text) &
"Databases/"
property databaseName : "myDatabase"
property databasePath : quoted form of (databaseFolder & databaseName astext)
property table1 : "Main"

set xxx to do shell script "sqlite3 " & databasePath & " \"select *
from "& table1 & ";
\""

Thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users