[sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Sam Carleton
I am current developing a system only on Windows, but I do plan to port it to OSX someday. I am passing ID's as strings to keep maximum flexibility between databases and the existing system. So how do I convert a sqlite3_int64 to a string and a string to a sqlite3_int64 in a cross platform fashio

Re: [sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-04 Thread Sam Carleton
Ken, this is true, except that I might migrate the system to some other database someday that wants to use something else as PK other than an int or int64 (MS SQL is optimized for guid's not int), so passing around the id's as strings keeps all the middle and front end code neutral :) Sam K

Re: [sqlite] How to exit from sqlite shell?

2009-05-04 Thread Sam Carleton
prefix with a period: .exit Lucius Fox wrote: Hi, Can you please tell me how to exit from sqlite shell? I try typing 'exit', 'quit', '.quit' or press cTRL X CTRL c, but they don't work. sqlite> exit ...> quit ...> ^X^C ...> ^C ...> ^X^C ...> .quit Thank you. _

[sqlite] which is faster SQLite or STL Map?

2009-05-04 Thread Sam Carleton
Here is my situation: I have a SQLite table that has a customer id, the folder id, and the image id (filename). This is a favorites table, so for a given customer and folder, there is going to be a small set of images in the table. The operation is to scan the folder/directory on the HD for all

Re: [sqlite] which is faster SQLite or STL Map?

2009-05-04 Thread Sam Carleton
I figure out a better solution than the two I initially proposed: Create a temp table to put the image names into and then use a left outer join to get the answer. Sam On Mon, May 4, 2009 at 7:49 PM, Sam Carleton wrote: > Here is my situation: > > I have a SQLite table that has a cu

[sqlite] Lets be realistic about errors

2009-05-06 Thread Sam Carleton
I have completed all the back end development that is using SQLite, minus on issue: error handling I am using SQLite in Axis2/C web services on Windows and later on OSX. On Windows Apache starts up lots of threads and eventually spawns more processes, I think in the *NIX world it simply spa

[sqlite] setting a date in a BEFORE INSERT trigger

2009-05-09 Thread Sam Carleton
This is my first BEFORE INSERT trigger in SQLite and I am getting an error: SQL error: near "new": syntax error My goal is that on an insert only the insertedby value is provide. The trigger will set that to the updatedby, insertedon and updatedon fields. I searched the web and the only examples

Re: [sqlite] setting a date in a BEFORE INSERT trigger

2009-05-09 Thread Sam Carleton
Actually that will not work the long term. I am going to have a update trigger to do the same basic thing and default values will not work there;) I would also really like to enforce on insert that both inserter and updater be the same. Sam On 5/9/09, Swithun Crowe wrote: > Hello > > SC My goal

Re: [sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Sam Carleton
Joanne, Igor was saying: Assuming you are only doing one update either works and #2 is faster for you to implement. On the other hand, if there is a long list of id's to update, than #1 is faster if you only prepair the statement once and bind multiple times. On a side note, with respect t

[sqlite] CURRENT_TIMESTAMP precision

2009-05-15 Thread Sam Carleton
I would like CURRENT_TIMESTAMP to be more accurate than just one second, any suggestions on how I might do that once? My solution is all a C/C++ interface, so all features are open to me. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sql

[sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
I am far from a SQL expert, but I am 99.9% sure there is SQL syntax to limit the number of results, I have not looked it up but I will in a little while... I only need one result. Since I am working with the C/C++ API, I plan to simply call sqlite3_step() only once. Is there any point in using t

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Marco Bambini wrote: SELECT ... LIMIT 1; Marco, Is this to say that adding the LIMIT 1 does make it more efficient? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Kees Nuyt wrote: Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset before it can return the first row in the resultset. Need I say more? http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor Thank you for the link, it is a VERY useful read, VERY useful! Sam

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread Sam Carleton
most notably Microsoft SQL Server. HTH. -Shane On Tue, May 19, 2009 at 2:23 PM, Sam Carleton wrote: Kees Nuyt wrote: Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset before it can return the first row in the resultset. Need I say more? http://www.sqlite.org/cvstrac

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread Sam Carleton
John Elrick wrote: John Stanton wrote: Igor Tandetnik wrote: John Stanton wrote: Shane Harrelson wrote: Additionally, it's important to note that the LIMIT/OFFSET clause is not standard SQL What makes you think tha

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread Sam Carleton
John Elrick wrote: Sam Carleton wrote: John Elrick wrote: John Stanton wrote: Igor Tandetnik wrote: John Stanton wrote: Shane Harrelson wrote: Additionally, it's important to note that the LIMIT/O

[sqlite] dealing with dates...

2009-05-24 Thread Sam Carleton
I am using julianday('now') to set the insertedon date to my tables. The value needs to be returned to the client via Web Service so that the client and return it later to get the next inserted record.  I am currently returning it as a double, somewhere along the way it is getting trunkated: From

[sqlite] [OT] How to implement paging

2009-05-25 Thread Sam Carleton
I want to thank the mailing list in general you all have been very helpful in my learning both SQLite and SQL in general. I am working on paging right now and simply don't know the SQL way of implementing it.  I have read through the SQLite page on scrolling cursor (http://www.sqlite.org/cvstrac/w

Re: [sqlite] [OT] How to implement paging

2009-05-25 Thread Sam Carleton
On Mon, May 25, 2009 at 2:31 PM, Simon Slavin wrote: > > On 25 May 2009, at 6:58pm, Sam Carleton wrote: > >> Example:  Following the logic of the ScrollingCursor page, lets assume >> a total result set of 88 titles.  If the lasttitle happens to be the >> 29th title, so

Re: [sqlite] [OT] How to implement paging

2009-05-25 Thread Sam Carleton
On Mon, May 25, 2009 at 2:43 PM, Tito Ciuro wrote: > Hi Sam, > > On May 25, 2009, at 10:58 AM, Sam Carleton wrote: > >> Example:  Following the logic of the ScrollingCursor page, lets assume >> a total result set of 88 titles.  If the lasttitle happens to be the >>

Re: [sqlite] [OT] How to implement paging

2009-05-25 Thread Sam Carleton
On Mon, May 25, 2009 at 4:05 PM, Teg wrote: > Hello Sam, > > Paging or scrolling is purely an abstraction you create with the GUI > itself. If you load up 88 titles into memory and your screen display is > 40 lines then you have 3 "pages" in memory and you simply replace a > "page" each time they

Re: [sqlite] [OT] How to implement paging

2009-05-25 Thread Sam Carleton
I understand and agree that things changing in the middle is not ideal. In the situation I am dealing with, things MUST disappear in the middle of the dataset. As far as adding things, it should happen at the end, but that is outside of my control, it all depends on how things are sorted. Normal

Re: [sqlite] Sqlite on a Virtual Machine of Microsoft's Hyper-V ?

2009-05-29 Thread Sam Carleton
Well, Microsoft's Hyper-V is just like VMWare. It allows multiple OS's to be installed and running on one machine at one time. Since sqlite is simply reads/writes to a file, not track/sectors, it should be fine. SQLite won't even know it is running on a virtual. Marcus Grimm wrote: Hello L

[sqlite] Virtual table or temp table, which is faster?

2009-06-09 Thread Sam Carleton
I am working on a web based kiosk system that displays images to 1 to 50, maybe 100 viewing stations. Currently I am using the file system (Windows) to store the images and to do lookups on the images. At one point I need to do a join between the images and a table (containing details about s

[sqlite] temp tables or virtual tables, which is faster?

2009-06-09 Thread Sam Carleton
I am working on a web based kiosk system that displays images to 1 to 50, maybe 100 viewing stations. Currently I am using the file system (Windows) to store the images and to do lookups on the images.  At one point I need to do a join between the images and a table (containing details about some

Re: [sqlite] temp tables or virtual tables, which is faster?

2009-06-09 Thread Sam Carleton
On Tue, Jun 9, 2009 at 10:17 PM, Alexandre Courbot wrote: > > > I have now learned about the concept of virtual tables.  Am I better > > of with my current approach because I can index the files in the temp > > table, or would I be better off using a virtual table to scan the hard > > drive for th

Re: [sqlite] Advice on which to use (SQLite or SQL Server) for the following app.

2009-06-11 Thread Sam Carleton
Jim Wilcoxson wrote: Here's what I'd try: 1. Write a small server that accepts connections and writes to the SQLite database using prepared statements. If you need require 500 transaction per second, it's simply not possible with rotating media. I am a late comer to this discussion, so this m

Re: [sqlite] Advice on which to use (SQLite or SQL Server) for the following app.

2009-06-11 Thread Sam Carleton
Jim, I am about to have my first one here in a few hours. Can you email me the program directly? Sam Jim Wilcoxson wrote: Hey, if anybody has an SSD laying around, it would be interesting to run that commit test program I posted a while back to see what kind of transaction rates are possibl

[sqlite] multiple prepare statements

2009-09-29 Thread Sam Carleton
The function is given a collection of data that needs to be either insert or update into the database. One options would be to use INSERT OR REPLACE INTO, but the desire is not to remove N add when it is an update, but simply do an update using the rowid. All the new items that need to be inserte

Re: [sqlite] multiple prepare statements

2009-09-30 Thread Sam Carleton
On Wed, Sep 30, 2009 at 10:02 AM, Scott Hess wrote: > > Since SQLite is an embedded database, it generally does not pay to > count statements, unless they add additional disk I/O.  You can code > like this: > >  BEGIN >    SELECT ... >    if (select results A) >      INSERT ... >    else >      UP

[sqlite] counting items before a ScrollingCursor

2009-10-26 Thread Sam Carleton
I am working with a data table that can have rows removed and added at any point in time. I am following the SQLite Scrolling Cursor wiki pageon implementing paging. The only thing I have left to figure out is how to determine how many items ar

Re: [sqlite] counting items before a ScrollingCursor

2009-10-26 Thread Sam Carleton
On Mon, Oct 26, 2009 at 7:58 AM, Igor Tandetnik wrote: > and then in your host app check for negative values and treat them as zero. > Or, if you insist on doing that in SQL: > > select (case when c > 0 then c else 0 end) from > (SELECT COUNT(title) - 5 as c FROM tracks > WHERE singer='Madonna'

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-26 Thread Sam Carleton
There is a WONDERFUL Firefox plug-in that I use, I love it! I am guessing it works on all OS's but I use it on Windows Vista and Windows 7. Sam On Mon, Oct 26, 2009 at 2:53 PM, Gilles Ganault wrote: > On Mon, 26 Oct 2009 11:31:50 +0500, "SQL Maestro Group" > wrote: > >SQLite Maestro allows you

Re: [sqlite] [Windows] Good GUI alternative to sqlite.exe?

2009-10-30 Thread Sam Carleton
the application. Sam On Fri, Oct 30, 2009 at 8:44 AM, Ted Rolle wrote: > On Fri, 30 Oct 2009 13:25:50 +0100 > Gilles Ganault wrote: > > > On Mon, 26 Oct 2009 15:07:38 -0400, Sam Carleton > > wrote: > > >There is a WONDERFUL Firefox plug-in that I use, I love it!

Re: [sqlite] Windows 7?

2009-11-03 Thread Sam Carleton
Nope, I have one binary for Window XP, Vista, and Windows 7. I only test the 32-bit code on 64-bit Vista and Win 7 and all runs just fine! On Tue, Nov 3, 2009 at 1:06 PM, Adam DeVita wrote: > Good day, > > Will a new DLL be required for Windows 7 ? > ___

[sqlite] implementing without right join...

2009-11-10 Thread Sam Carleton
This question is purely a theoretical and came up in a discussion today about joins in DB's that allow both left and right: Given three tables, A, B, and C, joined such that: A left join B right join C Is my impression correct that this translates into: (outer join A and C) inner join B

[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 I

[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 '192.168.1.1

[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 im

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 situation

[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] Access to SQLite via two languages in one process

2008-02-20 Thread Sam Carleton
I am working on a application that is currently access the SQLite database via PHP that is running under Apache as a module. The application also has a custom written Apache module written in C. Can I access the the SQLite database from both PHP and the Apache module? Sam ___

[sqlite] compiling C program to use the shared library

2008-02-23 Thread Sam Carleton
How do I compile a C program to use the shared DLL rather then statically link in SQLite? Sam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] compiling C program to use the shared library

2008-02-24 Thread Sam Carleton
On Sun, Feb 24, 2008 at 9:12 PM, Roosevelt Anderson <[EMAIL PROTECTED]> wrote: > To use the dll you need to use the LoadLibrary windows function and define > pointers to each of the sqlite functions. Here is a short example to get you > started. For more on using DLLs try this MSDN link: > > >

[sqlite] performance under load

2008-03-24 Thread Sam Carleton
My application is an apache based kiosk system that displays images. The SQLite database is used by PHP to track user info, who is logged in and what they have selected. SQLite is NOT managing anything about the files. I have a few customers that are running with 40 to 50 kiosks. >From the web s

Re: [sqlite] performance under load

2008-03-24 Thread Sam Carleton
On Mon, Mar 24, 2008 at 4:11 PM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote: > Try the math over: > > 24 hours * 60 minutes * 60 seconds = 86,400 seconds/day. > > 100,000 hits/day / 86,400 seconds/day = 1.1574 hits/sec (on average). > > Of course, this is on average. A real website gettin

[sqlite] SQLite with PHP and Apache C Module

2008-03-28 Thread Sam Carleton
My web application is a mix of PHP code and an Apache C Module. Both access the same SQLite3 database. Because of this, I am using the shared version of the PHP SQLite library and the Apache C module is dynamically linking, as well. The Apache C module only connects to the database during an adm

[sqlite] looking for tools to map SQLite to C++ objects

2008-09-25 Thread Sam Carleton
Does anyone know of any tools that are either open source or reasonably priced (less then 600 USD) for mapping SQLite to C++? Sam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] looking for tools to map SQLite to C++ objects

2008-09-25 Thread Sam Carleton
There seem to be a ton of tools out there now that will look at a table in a database and generate code to do selects, insert, updated, and deletes for languages like C#, VB.Net, Java, JavaScript, PHP and other higher level languages. I am looking for something like that for C++. Here are some t

[sqlite] Understanding TRANSACTION's

2010-03-07 Thread Sam Carleton
My use of SQLite is within a Apache module and Axis2/C web services. At a minimum, every request invokes a unique call to sqlite3_open_v2, most of the time there are multiple calls to sqlite3_open_v2, one for each specific task. An example would be the module part, which sends configuration to th

[sqlite] Understanding TRANSACTION

2010-03-07 Thread Sam Carleton
My use of SQLite is within a Apache module and Axis2/C web services. Every request invokes a unique call to sqlite3_open_v2, most of the time there are multiple calls to sqlite3_open_v2 in one request. For example the module part, which sends configuration to the web servers calls sqlite3_open_v2 a

Re: [sqlite] Understanding TRANSACTION's

2010-03-07 Thread Sam Carleton
Please ignore this post, I just followed up with another post with a lot more info, I am still having the problem, though. Sam On Sun, Mar 7, 2010 at 10:27 AM, Sam Carleton wrote: > My use of SQLite is within a Apache module and Axis2/C web services.  At a > minimum, every request inv

[sqlite] how to execute an ATTACH DATABASE?

2010-03-07 Thread Sam Carleton
sqlite3_finalize(stmt); if(rc == SQLITE_DONE) return SQLITE_OK; return rc; } Sam Here is the other post, if you want some context: On Sun, Mar 7, 2010 at 3:36 PM, Sam Carleton wrote: > My use of SQLite is within a Apache module and Axis2/C web services

Re: [sqlite] how to execute an ATTACH DATABASE?

2010-03-07 Thread Sam Carleton
On Sun, Mar 7, 2010 at 4:16 PM, Jean-Christophe Deschamps wrote: > >>ATTACH DATABASE ?1 as sysDB > > AFAIK you can't use parameter binding for anything else than litteral > values. > > It makes sense since it would be impossible for the parser and > optimizer to evaluate and produce run-time code

Re: [sqlite] Understanding TRANSACTION

2010-03-07 Thread Sam Carleton
I figured it out, I was NOT calling sqlite3_finalize(stmt) in the initial call to setDefaultIsInSlideShow() which was read only, so the table still had a read lock on it, so the read/write always failed. On Sun, Mar 7, 2010 at 3:36 PM, Sam Carleton wrote: > My use of SQLite is within a Apa

Re: [sqlite] how to execute an ATTACH DATABASE?

2010-03-07 Thread Sam Carleton
There is another condition I didn't see originally: You have to attach to the other database BEFORE starting the transaction. P.S. Who ever is responsible for putting in helpful error messages, God bless you! On Sun, Mar 7, 2010 at 4:34 PM, Sam Carleton wrote: > On Sun, Mar 7, 2

[sqlite] locking across the network...

2010-03-26 Thread Sam Carleton
I am currently using SQLite in my client/server application: Server: Apache Web Server -- the sole process that access the SQLite databases Client A: Admin Client to configure the server, there is only 1 instance of this client. Client B: Kiosk Client, there is 1 or more of these, some have over 5

Re: [sqlite] Fw: SQLite and Windows 7

2010-04-23 Thread Sam Carleton
> Hello, > > in the near future we will implement windows 7. My question: Is > SQLite running on windows 7? I have been running an older version of SQLite on Windows 7 ever since RTM back in August of last year. The only issue I would see you having is if the host application does not have write

Re: [sqlite] [server] HTTP + SQLite bundled as single EXE?

2010-05-03 Thread Sam Carleton
On Mon, May 3, 2010 at 6:24 AM, Simon Slavin wrote: > > The problem is not in coding it -- that's relatively easy. The problem is > in who would use it. I think that would be mostly people who already use > PHP to write a backend data server. The advantage of this is that it can be > done usin

[sqlite] multi-threaded vs multi-process, is there a difference?

2010-05-03 Thread Sam Carleton
I am using SQLite as the backend to my little Windows Apache server based kiosk system. I load tested it with 50 clients running slide shows, aka hitting the apache server every 5 seconds and all ran wonderfully! Apache on Windows is threaded, so I only had one process running. Each connection d

[sqlite] Understanding locking and connections

2010-05-15 Thread Sam Carleton
Everything appears to be running fine, but... I was reading the thread late last week about SQLITE_BUSY and it got me wondering if I am doing things correctly. For starters, my usage of SQLite is in an Windows Apache Module and within some Axis2/C web services loaded via the Apache Modules. What

Re: [sqlite] Understanding locking and connections

2010-05-16 Thread Sam Carleton
On Sat, May 15, 2010 at 6:12 PM, Simon Slavin wrote: > > On 15 May 2010, at 10:09pm, Sam Carleton wrote: > > > Everything appears to be running fine, but... I was reading the thread > late > > last week about SQLITE_BUSY and it got me wondering if I am doing things &g

[sqlite] read only databases and in-memory databases

2010-05-17 Thread Sam Carleton
Current situation: 1. Open a DB for read/write 2. Create a temp table 3. Read data from outside source and put into the temp table 4. Do a join on the temp table and another table in the DB 5. Return results This is happening a lot, and it might be the cause customers are having pr

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Sam Carleton
On Mon, May 17, 2010 at 9:32 AM, Black, Michael (IS) wrote: > Well...you don't say what "problem" your customers are having. Would be > nice to know for us to help you. > At this point in time I am purely theorizing, the client is seeing a break down in communications between the Silverlight ap

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Sam Carleton
to point it out to > you. > > See this thread where it was discussed quite a bit > > http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2010-May/021263.html > > > > Michael D. Black > Senior Scientist > Northrop Grumman Mission Systems > > > __

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Sam Carleton
On Mon, May 17, 2010 at 2:27 PM, Black, Michael (IS) wrote: > Not rude -- just a communications problem... > > There's a difference between read-only and exclusive. > > Read-only just means you can't do inserts and creates. It's not the write > mode of the database that matters. It's the transa

[sqlite] Force the use of the _v2 functions

2010-05-17 Thread Sam Carleton
I just looked through the header file and it looks like there is no macro to focus the use of the newer _v2 functions. What is the reasoning behind that? Personally I would love to set a macro which would simply eliminate the older functions so that I don't use them inadvertently. Sam __

Re: [sqlite] Force the use of the _v2 functions

2010-05-17 Thread Sam Carleton
to update the header file. Also I think others might benefit from such an option. Just a thought;) Is this something I could do and submit back to the project? Sam On Mon, May 17, 2010 at 10:12 PM, Simon Slavin wrote: > > On 18 May 2010, at 3:06am, Sam Carleton wrote: > > >

[sqlite] sqlite3_prepare_v2 && SQLITE_BUSY

2010-05-17 Thread Sam Carleton
For those of you following along my life (which I hope none of you are), I am working on cleaning up my code to handle SQLITE_BUSY correctly. The first issue I think I just successfully overcame was how to lock the DB to get my code to return a SQLITE_BUSY. What I did was use the Firebird plugin

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Sam Carleton
On Tue, May 18, 2010 at 7:35 AM, Black, Michael (IS) wrote: > I think I see a potential problem with your logic. You say "up to 2 > seconds" and "up to 4 times". So it sounds like you're doing a 500ms sleep > on your retry with 4 tries? > Actually no, not just 4 retries. What I did was use so

[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: 212-4*5

Re: [sqlite] FTS1 or FTS2

2010-05-26 Thread Sam Carleton
2010 at 2:47 PM, Roger Binns 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 should be FTS1, correct? > >

[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 not

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 control the VERSION. I do

[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 a

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 sin

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 files, databases are >> for handle data. >> > > Well,

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 expected. Thus the answer to my

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 DB, and displaying

[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: Selec

[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, Im

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
uch like something around the THEN statement. Sam On Sun, Jun 20, 2010 at 9:33 AM, Igor Tandetnik wrote: > Sam Carleton wrote: >> This works great.  The issue is that the image returned might NOT >> exist anymore, so I created an extension function to return 1 if it >> exist

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
quot; : http://www.sqlite.org/lang_expr.html > > On Mon, Jun 21, 2010 at 2:28 AM, Sam Carleton > 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 columns, while WHEN is a

[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 r

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 case when instertedon

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
o account. Thus, the findLargeImage() is *NOT* short-circuiting the query. Sam On Sun, Jun 20, 2010 at 6:02 PM, Simon Slavin wrote: > > On 20 Jun 2010, at 10:40pm, Sam Carleton wrote: > >> I am getting the EXACT same result, it calls findImage on for EVERY >> row in the re

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 if > there is no > me

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 Igor. There is never any

Re: [sqlite] When to close a db?

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 6:07 PM, Simon Slavin 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 under >> Apache.  Fr

Re: [sqlite] optimizing use of extension function

2010-06-20 Thread Sam Carleton
On Sun, Jun 20, 2010 at 9:56 PM, Igor Tandetnik wrote: > Sam Carleton wrote: >> 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? >> >&g

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
y 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 wrote: > > Through one request from the client, I open and close the database > multiple times. Since everything is very module, I am taking

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 > free product DUMA.

Re: [sqlite] When to close a db?

2010-06-21 Thread Sam Carleton
On Mon, Jun 21, 2010 at 12:24 PM, Roger Binns 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 to do with it (opportunity cost). 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 th

[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 result

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 wrote: > On Mon, Jun 21, 2010 at 11:56:09PM -0400, Sam Carleton scratched on the > wall: > > > I am NEVER capturing anything

  1   2   3   >