[sqlite] Unable to prepare a statement

2014-10-14 Thread Sam Carleton
is opening the DB is in a base class which is used other places to access the EventNode table, so I am a bit mystified as to what exactly is going on. Any thoughts? -- Pax vobiscum, Sam Carleton ___ sqlite-users mailing list sqlite-users@sqlite.org http

Re: [sqlite] Unable to prepare a statement

2014-10-16 Thread Sam Carleton
Yes, that was the case. The app has two databases, a system wide DB and the active data DB. The system points to the active data DB but wasn't configured to point to the active data. Live and learn:) Pax vobiscum, Sam Carleton On Wed, Oct 15, 2014 at 6:01 AM, Dan Kennedy <danie

[sqlite] creating trigger to handle multiple types of insert

2014-11-26 Thread Sam Carleton
There are two different types of insert that need to happen into a table, one is where the rowid (EventNodeId) is part of the actual insert, the other it is excluded so that AUTOINCREMENT will fill it in. There is an insert triggers to set the audit fields on the table during the insert. The

[sqlite] no such function: sqlite_attach?

2011-03-07 Thread Sam Carleton
Ok, a few weeks ago I posted an issue that I was having with the attach commend because the path has a single quote in it. Someone suggested I use the sqlite_attach() function which allegedly can be parametrized. Well, I finally got around to it this evening but I am missing something. Here is

[sqlite] SQLite IDE's

2011-03-22 Thread Sam Carleton
I am looking for a good SQLite IDE, SQLite Maestro looks like a good candidate with most all the features I need. The price is good, too. The one feature I don't see is a tool that can do a diff on the DDL of two SQLite db's. Does anyone know of any other SQLite IDE's that have that ability?

Re: [sqlite] SQLite IDE's

2011-03-22 Thread Sam Carleton
On Tue, Mar 22, 2011 at 3:26 PM, Jonathan Allin wrote: > Would the diff have to do more than compare (in some nice graphical way) the > two sqlite_master tables? What I am looking for is this: I have one version of the DB out in the field, I have made changed to it

Re: [sqlite] SQLite IDE's

2011-03-22 Thread Sam Carleton
On Tue, Mar 22, 2011 at 4:02 PM, Ben wrote: > You don't mention which platform you're on, but for OS X there's a good > comparison table of SQLite editors here: > > http://www.barefeetware.com/sqlite/compare/?ml Ben, I have a Mac, but I am currently targetting

[sqlite] adding/dropping foreign key to existing table

2011-03-22 Thread Sam Carleton
I don't see any examples on http://www.sqlite.org/foreignkeys.html how to either add or drop a foreign key to an existing table. What might that syntax look like exactly? Also, from a performance perspective, is there an advantage to using a foreign key in SQLite verses just an index? (aka, is

Re: [sqlite] adding/dropping foreign key to existing table

2011-03-23 Thread Sam Carleton
On Tue, Mar 22, 2011 at 10:55 PM, BareFeetWare wrote: > > You have to drop the old table and create a new one with the changed > foreign keys. This is a bummer. Is there any desire/plan to add an alter feature, in the future? > > Also, from a performance

Re: [sqlite] adding/dropping foreign key to existing table

2011-03-23 Thread Sam Carleton
On Wed, Mar 23, 2011 at 12:20 PM, Nico Williams wrote: > I do think that SQLite3 will eventually need to grow ALTER support for > altering constraints. This whole copy-the-table thing is not really a > scalable solution. Without such ALTER functionality users will often >

Re: [sqlite] adding/dropping foreign key to existing table

2011-03-23 Thread Sam Carleton
On Wed, Mar 23, 2011 at 2:00 PM, Nico Williams wrote: > Also, just to be clear, making the schema writable and then making any > updates to sqlite_master is completely unsupported, and should be. > This is good, very good, IMHO. Which is also why I won't do it:) hehehehe

[sqlite] sqlite3_step behavior on empty set

2011-03-27 Thread Sam Carleton
Is my impression correct that when calling sqlite3_step() on a query that returns no rows, the result will be [SQLITE_DONE]? If that is the case, might that be added to the documentation? ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] primary key on two columns of an associative table

2011-03-28 Thread Sam Carleton
The system calls for an associative table, a table with two foriegn keys to two other tables, allowing for a many to many relationship. Is there any way to make the primary key be both the columns? CREATE TABLE Invoice_Item_Favorite( Invoice_Item_Id INTEGER, FavoriteId INTEGER,

[sqlite] how to reuse a prepaired statement

2011-04-22 Thread Sam Carleton
I am implementing a dataset update process.  There is a for loop going through the dataset either doing an update on the row or deleting the row.  So there are two statements that are preparied, currently I am using the same basic logic for both. The problem is the second time around I get a

Re: [sqlite] how to reuse a prepared statement

2011-04-23 Thread Sam Carleton
On Fri, Apr 22, 2011 at 11:44 PM, Drake Wilson wrote: > You probably need to sqlite3_reset the statement after stepping it. Can someone then explain the purpose of sqlite3_clear_bindings()? If I understand things correctly, you call sqlite3_reset() to reuse a prepaired

[sqlite] Understanding a non trivial query plan

2011-04-27 Thread Sam Carleton
I am trying to track down an issue that I MIGHT have with the following query. The explain query is a bit complex and I cannot tell if it is OK or if there are issues. Here it is: sqlite> EXPLAIN QUERY PLAN ...> SELECT DISTINCT f1.FolderId, f1.ImageId, ...>

[sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
How does one go about finding out how many rows a query returns? Is there a way to find out the id of a particular column? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 11:09 AM, Jean-Christophe Deschamps wrote: > >> How does one go about finding out how many rows a query returns? > > This is the number of time sqlite3_step can be called successfully > until it returns SQLITE_DONE. I had it wrong in the email body, I

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 12:53 PM, "Igor Tandetnik" <itandet...@mvps.org> wrote: > Sam Carleton <scarle...@gmail.com> wrote: >> I had it wrong in the email body, I meant how many columns are in query? > > sqlite3_column_count. Don't even need to execute the qu

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 11:06 AM, "Jay A. Kreibich" <j...@kreibi.ch> wrote: > On Sun, May 08, 2011 at 11:00:29AM -0400, Sam Carleton scratched on the wall: > >> Is there a way to find out the id of a particular column? > > sqlite3_column_name() I want to go the ot

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On Sun, May 8, 2011 at 3:08 PM, Simon Slavin wrote: > > Out of interest, are you trying to analyse the results of a "SELECT *" ? > Because since it's your query in the first place, you should know what > columns you asked for. > Nope, I NEVER do SELECT *, very, very

[sqlite] handling SQLITE_LOCKED same as SQLITE_BUSY

2011-05-19 Thread Sam Carleton
I just did a quick load test on my little web app that is using SQLite in C code.  Pretty quick it ran into a SQLITE_LOCKED while a connection/user was logging in to the site.  I have some code that responds to SQLITE_BUSY by sleeping for 50 mills and retrying 4 times: int rc =

[sqlite] Howto pivot in SQLite

2011-06-05 Thread Sam Carleton
I have a invoice system where one invoice item can have one or more sum items (images). Example is a CD... The invoice item is a CD, there are an infinite numbers of images associated with that CD invoice item. So I have the following: CREATE TABLE Invoice_Item ( Invoice_Item_Id INTEGER

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Sam Carleton
On Sun, Jun 5, 2011 at 1:04 PM, Simon Slavin wrote: > > Take a look at the group_concat() function: > > http://www.sqlite.org/lang_aggfunc.html > That is PERFECT, thank you! If the person who thought of this function originally is reading this, thank you!!! What a time

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Sam Carleton
On Sun, Jun 5, 2011 at 5:44 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Sun, Jun 05, 2011 at 12:47:47PM -0400, Sam Carleton scratched on the > wall: > > > In one select statement, I want to return a view of all the Invoice_Items > > for a particular Invoice su

Re: [sqlite] Howto pivot in SQLite

2011-06-06 Thread Sam Carleton
release. There is a lot to come, I just need to get this out the door as quickly as possible while providing useful information to my users. Sam On Sun, Jun 5, 2011 at 8:17 PM, BareFeetWare <list@barefeetware.com>wrote: > On 06/06/2011, at 8:30 AM, Sam Carleton <scarle...@milt

[sqlite] optimizing an update

2011-07-03 Thread Sam Carleton
I have a select statement that is calculating the subTotal, Tax, and grand total: UPDATE Invoice SET Sub_Total = (select sum(PRICE * QTY) from INVOICE_ITEM where INVOICE_ID = @invoiceId), Tax = (select round( sum(PRICE * QTY) * ( @tax / 100) + .005, 2) from INVOICE_ITEM where INVOICE_ID

[sqlite] Compound update isn't working as I expect

2011-07-03 Thread Sam Carleton
It is very clear to me that my expectations are wrong, please enlighten me... Here is the query: update INVOICE set SUB_TOTAL = (select sum(PRICE * QTY) from INVOICE_ITEM ii where ii.INVOICE_ID = *INVOICE_ID*), TAX = (select round( sum(PRICE * QTY) * ( 8.25 / 100) + .005, 2) from

[sqlite] Does coalesce terminate early?

2011-09-14 Thread Sam Carleton
Forgive me, fore I have forgotten the term used to describe the behavior if a C if statement where it stops executing on the first false statement, but... Does coalesce do that? I have to put together a query that has a coalesce such that if the row from the table is null, it then does a

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 6:38 AM, Richard Hipp <d...@sqlite.org> wrote: > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton <scarle...@miltonstreet.com > >wrote: > > > Forgive me, fore I have forgotten the term used to describe the behavior > if > > a C i

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 10:05 AM, Simon Slavin wrote: > > Documentation for COALESCE is here: > > http://www.sqlite.org/lang_corefunc.html > > It does not say whether it does short-circuit evaluation but the description > does imply testing one by one, rather than

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 12:24 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 15 Sep 2011, at 5:00pm, Sam Carleton wrote: > >> I don't mean to be difficult, but I simply don't get any indication of >> how exactly COALESCE actually functions from this descr

[sqlite] how to disable a trigger

2011-10-02 Thread Sam Carleton
Is there any way to "disable" a trigger in sqlite? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to disable a trigger

2011-10-02 Thread Sam Carleton
Ok, how do I list what a trigger is so that I can add it back once I want to "reactive" it? On Sun, Oct 2, 2011 at 9:07 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Sam Carleton <scarle...@miltonstreet.com> wrote: > > Is there any way to "disable&qu

Re: [sqlite] how to disable a trigger

2011-10-03 Thread Sam Carleton
to the document db, the triggers need to be off. Sam On Mon, Oct 3, 2011 at 4:51 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 3 Oct 2011, at 4:12am, Sam Carleton wrote: > > > Ok, how do I list what a trigger is so that I can add it back once I want > to > > "react

[sqlite] Understanding conditional triggers

2016-03-02 Thread Sam Carleton
vobiscum, Sam Carleton

[sqlite] Understanding conditional triggers

2016-03-04 Thread Sam Carleton
> > Does this trigger not compute, is not accepted, or does not work once > installed? What is the problem exactly? > It works fine. Initially I was not able to find any good examples of a conditional trigger but after a lot more searching I was able to find one that validated that it might

[sqlite] php connections strings

2008-02-12 Thread Sam Carleton
Despite over 12 years in software development, I have been able to avoid databases for a great part of that time. The real bane in my side when it comes to SQL databases is connection strings. I would like to use SQLite 3 in my PHP project, but I need some help on how to construct the connection

[sqlite] creating a table with an index

2008-02-13 Thread Sam Carleton
I am trying to create a table with two indexes: CREATE TABLE favorites ( cust_id CHAR(32) NOT NULL, fldoid CHAR(38) NOT NULL, imgoid CHAR(64) NOT NULL, PRIMARY KEY (cust_id), INDEX (fldoid, imgoid)); SQLite keeps complaining saying there is an error around INDEX. What might

[sqlite] SQLite to xml schema mapping tools

2008-02-15 Thread Sam Carleton
Are there any tools out there that can look at a SQLite database and create a XML Schema that I can use with propel ORM? Sam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] deleting syntax w/ PHP's PDO

2008-02-16 Thread Sam Carleton
This might be a really basic question and it might be PHP related, not SQLite, I am not sure... I know that the traditional way to do a delete would be this: DELETE FROM users WHERE ipaddress = '192.168.1.1' But I have also seen syntax where the actual statement does NOT contain the

[sqlite] which is faster, PHP or SQLite?

2008-02-18 Thread Sam Carleton
I am new to SQLite and databases, so I am stil learning how to optimize their use... I am working on a "shopping cart" type of feature, it is actually a favorites feature for a system that displays images in multiple galleries. There is a SQLite table that contains the user_id, gallery_id, and

Re: [sqlite] which is faster, PHP or SQLite?

2008-02-18 Thread Sam Carleton
On Feb 18, 2008 11:33 AM, Scott Baker <[EMAIL PROTECTED]> wrote: > > The less database hits you have to do, the faster your code will be. > Getting all the data into a PHP data structure should be the way to go. After reading all the replies, I have to agree with Scott for my particular

[sqlite] what platforms does SQLite run on?

2008-02-19 Thread Sam Carleton
I see that SQLite runs on Windows, OSX, and *NIX, will it run on Windows Mobile (CE) or any embedded OS's? Sam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] FTS1 or FTS2

2010-05-26 Thread Sam Carleton
First off, I am not even positive that I need FTS. What I need to do is a search from a phone number column on a parcel phone number. Example: Dataset: 212-456-7890 212-789-1234 212-564-9875 212-357-8452 212-285-6100 560-851-5522 If searching for a number with '56', I want to get back:

Re: [sqlite] FTS1 or FTS2

2010-05-26 Thread Sam Carleton
at 2:47 PM, Roger Binns <rog...@rogerbinns.com> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 05/26/2010 10:24 AM, Sam Carleton wrote: > > If I do opt to use FTS, which one should I be using, FTS1 or FTS2? > > According to the web site, it sho

[sqlite] SQLite and Qt

2010-06-08 Thread Sam Carleton
I have been using SQLite for a few years now in an Apache server module and it works great for me. The system is expanding, I am working on a Qt based GUI program that needs to access the SQLite database. (The Qt program is only going to run on the same machine as the Apache Server.) If I am

Re: [sqlite] SQLite and Qt

2010-06-08 Thread Sam Carleton
On Tue, Jun 8, 2010 at 10:25 PM, Bill King wrote: > > > > >1. How do I control the version of SQLite used with Qt? > > > ./configure -system-sqlite will use the sqlite compiled for your system. > No, not how do I compile SQLite into Qt, I have done that. I want to

[sqlite] compiling in foreign key support

2010-06-09 Thread Sam Carleton
>From looking at the compile page (http://www.sqlite.org/compile.html), I am not seeing any compile options to turn on foreign key support. Was it left out of the documentation or does the feature really not exist yet? If the feature isn't there yet, it would be really nice, there will never be

Re: [sqlite] SQLite and Qt

2010-06-14 Thread Sam Carleton
Sylvain, I have given it a try and it isn't working. First a quick questions: Is qsqlite.dll statically linked to the sqlite code or dynamically linked? The sqlite3.lib I am trying to link to is the for dynamically linking, aka requiring the sqlite3.dll. I am guessing that is the issue, but

Re: [sqlite] BLOB Support

2010-06-16 Thread Sam Carleton
On Wed, Jun 16, 2010 at 8:34 AM, P Kishor wrote: > On Wed, Jun 16, 2010 at 7:23 AM, Andreas Henningsson > wrote: >> Do some testing to find out if it suits the application you develop. >> But just in general .. file systems are build to handle

Re: [sqlite] SQLite and Qt

2010-06-16 Thread Sam Carleton
On Tue, Jun 15, 2010 at 7:11 AM, Sylvain Pointeau wrote: > Hi, > > What is the error? > did you make a sample project that you could share? The error was between the keyboard and the chair... Once the SQLite DLL was moved into the Qt bin directory, all worked as

Re: [sqlite] BLOB Support

2010-06-16 Thread Sam Carleton
On Wed, Jun 16, 2010 at 10:04 AM, Teg wrote: > Hello Sam, > > I store multiple gigs of image files, some as large as 2-3 megs in > Sqlite DB's. For pretty much the same reason, the convenience of > having them in one package. For my requirements, extracting the images > from the

[sqlite] where to find an examples of writing a extension?

2010-06-19 Thread Sam Carleton
I need to add a new where clause to my query, one that checks to see if the file actually exits. I am thinking the correct solution is a user defined function, something like: bool DoesFilesReallyExist(char* rootPath, char* relativePath, char* filename) Where I could do a query like this:

[sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
I am working on a slide show feature. The logic is based on time, there are a set of image metadata (folderId and filename) add to the DB, the insertion time is also saved. The client calls the getNextSlideShow() method to get the next image. The current select statement is: SELECT FolderId,

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
ike something around the THEN statement. Sam On Sun, Jun 20, 2010 at 9:33 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Sam Carleton <scarle...@miltonstreet.com> wrote: >> This works great.  The issue is that the image returned might NOT >> exist anymore, so I created an

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
ot;The CASE Expression" : http://www.sqlite.org/lang_expr.html > > On Mon, Jun 21, 2010 at 2:28 AM, Sam Carleton > <scarle...@miltonstreet.com> wrote: >> Igor, ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 4:52 PM, P Kishor wrote: > > No. WHERE clause is a completely different part of the statement, > different from WHEN which is a part of the CASE construct. "CASE.. > WHEN .. THEN .. ELSE .. END" is one construct, an expression, and > applies to the

[sqlite] When to close a db?

2010-06-20 Thread Sam Carleton
I am getting some strange behavior out of my app, which happens to be both an Apache module and some Axis2/C Web Services which run under Apache. From time to time, it is VERY inconsistent, when the code calls sqlite3_close() the Apache server crashes. I don't recall the error right off. >From

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 5:23 PM, Igor Tandetnik wrote: > In what way did the statement I gave you, exactly as written, fail to satisfy > your requirements? Igor, When I put in EXACTLY what you gave me: SELECT FolderId, ImageId, instertedon FROM V_FAVORITES_SELECTED WHERE

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
taken into account. Thus, the findLargeImage() is *NOT* short-circuiting the query. Sam On Sun, Jun 20, 2010 at 6:02 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 20 Jun 2010, at 10:40pm, Sam Carleton wrote: > >> I am getting the EXACT same result, it calls findImage on for

Re: [sqlite] When to close a db?

2010-06-20 Thread Sam Carleton
On Jun 20, 2010, at 7:33 PM, Roger Binns wrote: > > That is bad advice! The return code of open is irrelevant. If ppDb > is set > to non-NULL then you need to call sqlite3_close on it. ppDb will > almost > always be set to something. One example of when it is not is

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 7:41 PM, P Kishor wrote: > Once again, did you try Igor's suggestion? Exactly as he suggested? > Don't know if it will work or not, but this I can say -- if there is > one person in the entire SQL world you should listen to very > carefully, it is

Re: [sqlite] When to close a db?

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 6:07 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 20 Jun 2010, at 10:17pm, Sam Carleton wrote: > >> I am getting some strange behavior out of my app, which happens to be >> both an Apache module and some Axis2/C Web Services which run

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 9:56 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Sam Carleton <scarle...@miltonstreet.com> wrote: >> On Sun, Jun 20, 2010 at 5:23 PM, Igor Tandetnik <itandet...@mvps.org> wrote: >> >>> In what way did the statement I gave you

Re: [sqlite] When to close a db?

2010-06-20 Thread Sam Carleton
Roger, I am 100% Windows:( I agree with you that it is "99 point lots of nines percent" my program, not SQLite. Especially because I added the SQLITE_DEBUG and it isn't catching anything extra. I am 99.9% sure the issue is NOT calling close on the db twice, I wrapped that in a C++ class so the

Re: [sqlite] When to close a db?

2010-06-21 Thread Sam Carleton
nder Linux so I > was only seeing the problem on some machines. Roger, Your post bring me back to what I asked in my last post: On Sun, Jun 20, 2010 at 11:31 PM, Sam Carleton <scarle...@miltonstreet.com> wrote: > > Through one request from the client, I open and close the dat

Re: [sqlite] When to close a db?

2010-06-21 Thread Sam Carleton
On Mon, Jun 21, 2010 at 11:29 AM, Pavel Ivanov wrote: >> hopefully there are better tools there for debugging this >> type of thing. > > There are, but usually they are not free. Quick googling for "valgrind > for windows" brought up commercial products Purify and Insure++ and

Re: [sqlite] When to close a db?

2010-06-21 Thread Sam Carleton
On Mon, Jun 21, 2010 at 12:24 PM, Roger Binns <rog...@rogerbinns.com> wrote: > > On 06/21/2010 08:44 AM, Sam Carleton wrote: > > I know I cannot afford ... > > For some reason you are assuming that your time is free and that you have > no > other things t

[sqlite] how often to open the db

2010-06-21 Thread Sam Carleton
I have asked this Q a number of times over the last year and NEVER gotten ANYONE to even comment on it. I am wondering why: Am I opening the DB too much? My usage of SQLite is in an Apache module that opens the DB each time it needs info from the DB: For authentication it is open/closed, for

[sqlite] When to close a db, take 2...

2010-06-21 Thread Sam Carleton
Ok, after a bit of testing this evening, the close which is crashing the system has ALWAYS been the same close statement, the close after the Apache Module has initialized the data structure to process the request. I went in and made sure that each and every sqlite call is log if there is a

Re: [sqlite] When to close a db, take 2...

2010-06-22 Thread Sam Carleton
a compare on it! I shake my head at myself sometimes. Thanks a million Jay, I really appreciate it! Sam On Tue, Jun 22, 2010 at 12:06 AM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Mon, Jun 21, 2010 at 11:56:09PM -0400, Sam Carleton scratched on the > wall: > > > I am NEV

Re: [sqlite] When to close a db, take 2...

2010-06-22 Thread Sam Carleton
On Tue, Jun 22, 2010 at 9:15 AM, Pavel Ivanov wrote: > > The idea is that the copy and nulling happens very quickly where the > > sqlite3_close is more expensive, do the copy/null very quickly so that if > > another thread calls Close during the first threads execution of > >

[sqlite] handling sqlite3_close() == SQLITE_BUSY

2010-06-22 Thread Sam Carleton
On Tue, Jun 22, 2010 at 10:13 AM, Pavel Ivanov wrote: > > No, I did not. I am not storing any blobs right now, but... Is the busy > > handler going to kick in? I know the busy handler is not the sole answer > to > > the problem, but it does seem to catch most of my

[sqlite] How to use load_extension()?

2010-06-26 Thread Sam Carleton
I have created a little extension function that I would like to load into my Qt program, so I am using the function load_extension, but it always returns false. I am currently hard coding the path: QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(systemDB);

[sqlite] dealing with evaluating user-entered SQL...

2010-06-27 Thread Sam Carleton
On Sat, Jun 26, 2010 at 11:22 PM, Igor Tandetnik <itandet...@mvps.org>wrote: > Sam Carleton <scarle...@miltonstreet.com> wrote: > > I have created a little extension function that I would like to load into > my > > Qt program, so I am using the function load_exte

Re: [sqlite] How to use load_extension()?

2010-06-27 Thread Sam Carleton
Jan, Actually I am already compiling sqlite to my liking and recompiling the Qt sqlite3 driver. The custom sqlite3 has foreign keys turned on by default. When you say I have to build my own driver, do you mean I simply need to make another modification to my sqlite3 or are you saying I need to

[sqlite] replacing a table

2010-06-27 Thread Sam Carleton
In other databases there have been times when I have played some tricks with the master tables, an example is: Goal: change some fundamental characteristics of 'target_table' which cannot be done by an ALTER 1: Create the new table with a different name: target_table2 with the changes 2: Do an

Re: [sqlite] Use of sqlite3_step()

2010-07-06 Thread Sam Carleton
I use a bit simpler approach, don't know if it is correct or not, but it seems to work: int rc = sqlite3_step(stmt); while(rc == SQLITE_ROW) { /* read the row info */ rc = sqlite3_step(stmt); } if( rc != SQLITE_DONE) { /* handle error */ }

Re: [sqlite] setup sqlite in vc++

2010-07-06 Thread Sam Carleton
On Tue, Jul 6, 2010 at 3:33 PM, smengl90 < fixed-term.seak.meng...@us.bosch.com> wrote: > > Hi guys, > > I am trying to setup sqlite to be used with VC++ 2008. Can someone show me > where I can find instructions on how to set it up? and do I need a c++ > wrapper to code in C++? If yes, can

Re: [sqlite] Books which cover C API

2010-07-07 Thread Sam Carleton
On Wed, Jul 7, 2010 at 2:55 PM, Jay A. Kreibich wrote: > > This one is coming out next month. I like it. > > http://www.amazon.com/Using-SQLite-Jay-Kreibich/dp/0596521189/ > Jay, Without knowing anything more about the book other then the link you provided, the one thing I do

Re: [sqlite] setup sqlite in vc++

2010-07-07 Thread Sam Carleton
On Wed, Jul 7, 2010 at 7:12 PM, Simon Slavin wrote: > > The precompiled binaries are for those who see SQLite as some sort of > external library and don't want to include it in their own application. > It's a useful alternative for those who want to keep their own app as

Re: [sqlite] sqlite query with c++ variable

2010-07-09 Thread Sam Carleton
On Fri, Jul 9, 2010 at 2:48 PM, smengl90 wrote: > > Hi, I want to compose a query that will use a c++ variable. For example I > have: > > int i= 5; > char * query = "SELECT * from userInfo WHERE count<'i'". > > The syntax does not work. How do I do that?

Re: [sqlite] concat 2 const chars ?

2010-07-09 Thread Sam Carleton
I really don't mean to be a jerk, but this does seem to be really off topic for this mailing list. Isn't the concatination of two string a general C/C++ question rather then a sqlite question? Don't you think you might be better off asking this question on a C/C++ mailing list or forum, maybe

[sqlite] why is this table locked?

2010-07-10 Thread Sam Carleton
I am on Window 7, opening an existing database with these flags: SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE Then I get a value from one table, begin a transaction, create a temp customer table, fill it with the current values from the customer table. Here is that SQL run

[sqlite] update trigger to require input

2010-07-11 Thread Sam Carleton
I have some audit fields, one being updatedby, I would like to create an update trigger that would prevent the row from being updated if this was not set. Can I do that in sqlite? ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] binding an IN

2010-07-11 Thread Sam Carleton
Is there any way to bind to this query? SELECT * FROM table WHERE tableId IN ( ? ); Where ? should be 1,2,3,4 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] EXTERNAL: binding an IN

2010-07-12 Thread Sam Carleton
)>1) { >printf("SQL too many parens?? - %s\n",sql); >} >puts(sql); > } > > > Michael D. Black > Senior Scientist > Northrop Grumman Mission Systems > > > > > From: sqlite-user

[sqlite] How is the table getting locked and how to unlock it?

2010-07-12 Thread Sam Carleton
I posted this over the weekend, I am assuming it was overlooked because it was, well, the weekend:) Does anyone have any thoughts? -- I am on Window 7, opening an existing database with these flags: SQLITE_OPEN_EXCLUSIVE |

Re: [sqlite] How is the table getting locked and how to unlock it?

2010-07-12 Thread Sam Carleton
On Mon, Jul 12, 2010 at 10:36 AM, Jay A. Kreibich wrote: > > Are you using sqlite3_exec() for all of these? My first guess is that > you're not finalizing the INSERT statement (or allowing it to run to > completion) before trying to drop the table. > I am using

[sqlite] ATTACH DATABASE with connection pooling

2010-07-18 Thread Sam Carleton
I am working with an Apache module that is using the Apache DBD connection pool system. The application always need to connect to two DB files, the "System DB" and the "Event DB". The System DB is the default, the "Event DB" is always connected via an ATTACH DATABASE called EventDB. The system

Re: [sqlite] ATTACH DATABASE with connection pooling

2010-07-18 Thread Sam Carleton
Is there any way to use the PRAGMA database_list in a query? What I would like to do is: SELECT * FROM (PRAGMA database_list) WHERE name = 'EventDB'; Sam On Sun, Jul 18, 2010 at 11:56 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 19 Jul 2010, at 4:48am, Sam Ca

[sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
How expensive is doing a PRAGMA database_list? I am using the connection pooling in Apache APR's DBD system. Currently there are multiple places with in one request that does the following: - Get a connection to the DB - Call PRAGMA database_list - Iterate through the list looking for

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 2:58 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 19 Jul 2010, at 3:50pm, Sam Carleton wrote: > > > I am using the connection pooling in Apache APR's DBD system.  Currently > > there are multiple places with in one requ

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 2:58 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 19 Jul 2010, at 3:50pm, Sam Carleton wrote: > >>   - Connection to the second one if it is old (wrong physical file) or not >>   connected. > > (Actually you will get other databas

Re: [sqlite] ATTACH DATABASE with connection pooling

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 4:02 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Mon, Jul 19, 2010 at 01:27:52AM -0400, Sam Carleton scratched on the wall: >> Is there any way to use the PRAGMA database_list in a query?  What I would >> like to do is: >> >> SELECT *

Re: [sqlite] Cost of PRAGMA database_list

2010-07-19 Thread Sam Carleton
On Mon, Jul 19, 2010 at 3:51 PM, Simon Slavin wrote: You know, I think that the most efficient way to do what you want will > probably to always issue the 'ATTACH' command. If EventsDB is already > attached, you should get a specific error code, which you can notice but >

Re: [sqlite] Cost of PRAGMA database_list

2010-07-20 Thread Sam Carleton
On Mon, Jul 19, 2010 at 9:46 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 20 Jul 2010, at 2:01am, Sam Carleton wrote: > > > On Mon, Jul 19, 2010 at 3:51 PM, Simon Slavin <slav...@bigfraud.org> > wrote: > > > >> You know, I think th

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Sam Carleton
On Tue, Jul 20, 2010 at 8:34 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 21 Jul 2010, at 12:42am, Sam Carleton wrote: > > > There are two equally > > important requires, one is to connect to the second "EventDB", the other > is > > that

Re: [sqlite] Cost of PRAGMA database_list

2010-07-21 Thread Sam Carleton
On Wed, Jul 21, 2010 at 9:47 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 21 Jul 2010, at 2:30pm, Sam Carleton wrote: > > > My issue with only attaching to the EventDB for only as long as a command > is > > trying to use it is: The EventDB is used a LO

  1   2   >