[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Stephan Beal
On Fri, May 8, 2015 at 7:01 PM, Stephen Broberg wrote: > (e.g., insert, update, delete, select, etc.). Specifically, I?d like to > know whether a statement that either has run or is about to be run (via > sqlite3_step) is a read-only (select) or write (pretty much everything > else) operation.

[sqlite] VBA Sqllite blob data

2015-05-08 Thread Bart Smissaert
What do you mean with: into Excel? Into a cell in the worksheet, into a VBA variable? What code did you try? I never use blobs, but I don't think it should be a problem. RBS On Fri, May 8, 2015 at 8:15 PM, Preston King wrote: > Does anyone have an example of how to read sqlite blob records, t

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Zsbán Ambrus
On Fri, May 8, 2015 at 8:20 PM, Simon Slavin wrote: > Suppose you have this statement > > DELETE FROM myTable WHERE id=600 > > and there are no rows with id=600. I presume that the function will return > FALSE but a literal reading of the description says that it will return TRUE. > If I'm rig

[sqlite] Copying an open DB file (iOS)

2015-05-08 Thread Simon Slavin
On 8 May 2015, at 6:54pm, Scott Perry wrote: > If you're using wal mode journalling (which I'd recommend for running on iOS > devices), you'll want to execute `PRAGMA wal_checkpoint(TRUNCATE);` before > closing your last connection to ensure you don't leave any data behind in the > journal wh

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Simon Slavin
On 8 May 2015, at 6:43pm, Peter Aronson wrote: > Well, there's sqlite3_stmt_readonly which appears to do pretty much what > you're asking for: https://www.sqlite.org/c3ref/stmt_readonly.html. Suppose you have this statement DELETE FROM myTable WHERE id=600 and there are no rows with id=600.

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
I installed TCL and then unpacked the SQLite archive, then typed "./configure; make test" what to do next? On Fri, May 8, 2015 at 6:13 PM, Richard Hipp wrote: > On 5/8/15, Sairam Gaddam wrote: > > Is sqllogictest a program which can be downloaded and installed? > > https://www.sqlite.org/sqllog

[sqlite] Multiple Prepared Statements

2015-05-08 Thread Richard Hipp
On 5/8/15, Scott Doctor wrote: > > Can I prepare multiple statements then implement them in > arbitrary order (based on some logic)? > > Or do the statements need to be prepared, stepped, finalized > serially? > They can be run in any arbitrary order. That is the usual case, actually. -- D. Ric

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
Is sqllogictest a program which can be downloaded and installed? On Fri, May 8, 2015 at 5:21 PM, Richard Hipp wrote: > On 5/8/15, Sairam Gaddam wrote: > > I have custom SQLite and in order to test it I downl > > oaded sqlite-src-3081000.zip > > (7.29 MiB) as advised, which contains some test fi

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Stephen Broberg
Using versions 3.8.5 and 3.7.7.1: Is there something in the SQLite C API that will tell what type of statement a prepared sqlite3_stmt is (e.g., insert, update, delete, select, etc.). Specifically, I?d like to know whether a statement that either has run or is about to be run (via sqlite3_step

[sqlite] Appropriate Uses For SQLite

2015-05-08 Thread Jim Callahan
SQLite in GIS I had known about Spatialite, but I hadn't realized that QGIS was using SQLite (both indpendently and through Spatialite). "While PostGIS is generally used on a server to provide spatial database capabilities to multiple users at the same time, QGIS also supports the use of a file fo

[sqlite] emptying tables

2015-05-08 Thread Simon Slavin
On 8 May 2015, at 1:27pm, Zaumseil Ren? wrote: > I started with the single table solution. But it was to slow on select and > the database was also bigger because of the id for each row. Now I can use > the timestamp as rowed. If it was slow on SELECT I suspect you didn't have an appropriate

[sqlite] Testing problem

2015-05-08 Thread Sairam Gaddam
I have custom SQLite and in order to test it I downl oaded sqlite-src-3081000.zip (7.29 MiB) as advised, which contains some test files but most of them are .test files and how to execute them? should I use sqllogictest program? If it should be used where is it available? And regarding .c test fil

[sqlite] Multiple Prepared Statements

2015-05-08 Thread Scott Doctor
So if I have a loop that finds a row with some data (statement1) then based on values from that row sets fields in other rows statement2 find a row to set new data statement3 set column to something, repeat n times. then go back and do it all again x times. I can prepare the 3 statements first the

[sqlite] VBA Sqllite blob data

2015-05-08 Thread Preston King
Does anyone have an example of how to read sqlite blob records, that are not pictures, into Excel? I have been trying to find some VBA code to do this but am not having much luck. Thanks

[sqlite] Multiple Prepared Statements

2015-05-08 Thread Scott Doctor
Can I prepare multiple statements then implement them in arbitrary order (based on some logic)? Or do the statements need to be prepared, stepped, finalized serially? Scott Doctor scott at scottdoctor.com --

[sqlite] emptying tables

2015-05-08 Thread Simon Slavin
On 8 May 2015, at 12:54pm, Zaumseil Ren? wrote: > I have a range of tables with rowid,value inside. Some have only few and some > other can have up to a million values. > Now I will empty all the tables and vacuum the database. Which is the fastest > way? > > > 1. A loop over all table

[sqlite] Copying an open DB file (iOS)

2015-05-08 Thread Simon Slavin
On 8 May 2015, at 8:09am, Jeff M wrote: > For a restore, the current DB is closed, then a backup file is copied in and > opened. > I've been using this scheme for years without a problem. But, should I > flush, or close, or lock before the copy? You need to close your connection, take the c

[sqlite] emptying tables

2015-05-08 Thread Zaumseil René
> The actual truth depends on finicky details of your own setup. But see the > last part of this page: > > > > "When the WHERE is omitted from a DELETE statement and the table being > deleted has no triggers, SQLite uses an optimization to erase the enti

[sqlite] emptying tables

2015-05-08 Thread Zaumseil René
Hi I have a range of tables with rowid,value inside. Some have only few and some other can have up to a million values. Now I will empty all the tables and vacuum the database. Which is the fastest way? 1. A loop over all tables with "delete * from tablename" (this is what I'm currently

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Scott Hess
On Fri, May 8, 2015 at 11:20 AM, Simon Slavin wrote: > On 8 May 2015, at 6:43pm, Peter Aronson wrote: >> Well, there's sqlite3_stmt_readonly which appears to do pretty much what >> you're asking for: https://www.sqlite.org/c3ref/stmt_readonly.html. > > Suppose you have this statement > > DELETE

[sqlite] emptying tables

2015-05-08 Thread Igor Tandetnik
On 5/8/2015 7:54 AM, Zaumseil Ren? wrote: > I have a range of tables with rowid,value inside. Some have only few and some > other can have up to a million values. > Now I will empty all the tables and vacuum the database. Which is the fastest > way? Close the connection, physically delete the da

[sqlite] Copying an open DB file (iOS)

2015-05-08 Thread Scott Perry
On May 8, 2015, at 4:47 AM, Simon Slavin wrote: > On 8 May 2015, at 8:09am, Jeff M wrote: > >> For a restore, the current DB is closed, then a backup file is copied in and >> opened. > >> I've been using this scheme for years without a problem. But, should I >> flush, or close, or lock befor

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Peter Aronson
Well, there's sqlite3_stmt_readonly which appears to do pretty much what you're asking for: https://www.sqlite.org/c3ref/stmt_readonly.html. Or, if you want more detailed control, there's the whole authorizer interface: https://www.sqlite.org/c3ref/set_authorizer.html. Peter On 5/8/2015 10:01

[sqlite] Determine type of prepared statement via C Interface?

2015-05-08 Thread Scott Hess
sqlite3_stmt_readonly(stmt)? This hits INSERT/UPDATE/DELETE, but not BEGIN/COMMIT/ROLLBACK. Or sqlite3_sql(stmt) if you want to do it heuristically by inspecting the statement. I think a "BEGIN READONLY" would be a sensible transaction type. Having a wrapper API force the developer to select rea

[sqlite] Testing problem

2015-05-08 Thread Richard Hipp
On 5/8/15, Sairam Gaddam wrote: > Is sqllogictest a program which can be downloaded and installed? https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki > > On Fri, May 8, 2015 at 5:21 PM, Richard Hipp wrote: > >> On 5/8/15, Sairam Gaddam wrote: >> > I have custom SQLite and in order to te

[sqlite] Testing problem

2015-05-08 Thread Richard Hipp
On 5/8/15, Sairam Gaddam wrote: > I have custom SQLite and in order to test it I downl > oaded sqlite-src-3081000.zip > (7.29 MiB) as advised, which contains some test files but most of them are > .test files and how to execute them? should I use sqllogictest program? If > it should be used where

[sqlite] SQLite4 on old 32-bit Linux

2015-05-08 Thread GB
Vladimir, > SQLite4 version [90c09b0451], 2014-09-19 18:48:23 > SQLite4 is under development and in no way considered stable. Maybe you're better off using a 3.x stable Version (currently 3.8.10). GB

[sqlite] Copying an open DB file (iOS)

2015-05-08 Thread Jeff M
I'm using SQLite (via FMDB) with an on-disk database in several iOS apps. In each case, the DB file is only used by the one app and there's no DB activity on background threads. The apps have a backup feature (initiated by the user) that simply copies the database file. There is no other acti