Re: [sqlite] Storing monetary values and calculations

2007-08-13 Thread John Stanton
If you store money as an integer with an "implied decimal point" (a familiar method for old-time COBOL programmers) it will work. We have added a DECIMAL type to Sqlite. This stores fixed point numbers in ASCII display format and performs accurate artithmetic and presents nicely from HTML.

Re: [sqlite] any way to find out how many current connections to db?

2007-08-12 Thread John Stanton
Try using lsof. Chase wrote: is there any way (in c/c++) to find out how many current connections there are to a database that i am connected to? i'd like to do some housekeeping on the database every so often, but only if there's no one else connected to it at the time. any ideas? thank

Re: [sqlite] sqlite3_open function

2007-08-11 Thread John Stanton
Perform an "access" or equivalent instruction before calling sqlite3_open. fred238 wrote: hello, Is there a way to not create a database while the db file is not found with the sqlite3_open function ? Why don't just create a create_table function instead of ? regards, fred. -

Re: [sqlite] Threading issues in SQLite

2007-08-10 Thread John Stanton
You might find that using one thread and accessing the four data sets sequentially yields you a better result. You will use the one Sqlite cache and get some benefit from not creating and detroying multiple caches and connections. Bharath Booshan L wrote: Hello All, I am using SQLite in on

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-10 Thread John Stanton
Sqlite has a feature where you can contanenate SQL statements and prepare and step them in a loop. Prepare returns a pointer to the start of the next statement. The basic prepare/step/reset activity requires that there be a loop to handle multiple rows, busy returns and possible errors. Ste

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread John Stanton
Definite enhancement without a downside from our perspective. [EMAIL PROTECTED] wrote: We are considering a change to the SQLite API which is technically not backwards compatible. On the other hand, it is difficult to imagine a situation where the change would cause anyone any serious hardship.

Re: [sqlite] UNION?

2007-08-08 Thread John Stanton
http://www.sqlite.org/lang_select.html Lee Crain wrote: The query at the bottom of this email is failing on the word "UNION". (The query works correctly in MS SQL Server.) I believe this is, unfortunately correct, since the SQLite documentation does not mention the reserved word "UNION" in the

Re: [sqlite] The Callback Function Interface?

2007-08-08 Thread John Stanton
instructions. Lee Crain wrote: John, Understood. Is the callback function interface going to be eliminated? What advantages does the new interface offer over the callback function interface? Lee Crain _ -Original Message- From: John Stanton [mailto

Re: [sqlite] Extremely new to SQLite

2007-08-08 Thread John Stanton
The callback interface is there to support legacy applications. It has been replaced by prepare/step for new work. Lee Crain wrote: Dennis, Are you certain that the callback function interface has been deprecated? From the link you posted: --- "2.2 Executing SQL statements

Re: [sqlite] Security Problem C/C++

2007-08-07 Thread John Stanton
Your Sqlite code looks OK. Your problem must be in your library or linking. Severin Müller wrote: Hey I don't even get to call the sqlite3_errmsg() function. My Program crashes with the call sqlite3_open(filename,&db); I'm been spending hours now, to figure out, what may cause that crap :) I

Re: [sqlite] how to create C functions and refer to them in sql

2007-08-07 Thread John Stanton
Chase wrote: okay, wait sorry wrong question. here's the deal. i want this trigger to fire -- and insert valid guids into a table -- even outside the context of my app. using sqlite3_create_function(), i can create a sort of temporary function that only works from with my app (or o

Re: [sqlite] sqlite as server queries

2007-08-07 Thread John Stanton
Edwin Eyan Moragas wrote: On 8/6/07, John Stanton <[EMAIL PROTECTED]> wrote: We use a single process server as an Sqlite server. It works well because it obeys certain constraints: o Transactions are always short o It has many users and many Sqlite databases, but each database do

Re: [sqlite] Re: Re: Re: Re: Re: Re: Re: How does SQLite choose the index?

2007-08-06 Thread John Stanton
this case. Are you going to make a mathematical model when you got a little stream to cross and you have a few available planks to do it? RBS -Original Message----- From: John Stanton [mailto:[EMAIL PROTECTED] Sent: 05 August 2007 16:43 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Re:

Re: [sqlite] [SQLite improve productivity]

2007-08-06 Thread John Stanton
Igor Mironchick wrote: Hi. How can I improve productivity of this code: a_messenger_t::data_buff_t --> std::deque< some_struct > // char * errors = 0; for( a_messenger_t::data_buff_t::const_i

Re: [sqlite] sqlite as server queries

2007-08-06 Thread John Stanton
Edwin Eyan Moragas wrote: hi group, i have several small questions for the group any experiences or thoughts shared would be greatly appreciated. 1) anybody used sqlite as a sql server? i'm thinking of say using the embedded sqlite in PHP5 or similar. 2) anybody ever implemented something like

Re: [sqlite] Re: Re: Re: Re: Re: Re: Re: How does SQLite choose the index?

2007-08-06 Thread John Stanton
. Are you going to make a mathematical model when you got a little stream to cross and you have a few available planks to do it? RBS -Original Message- From: John Stanton [mailto:[EMAIL PROTECTED] Sent: 05 August 2007 16:43 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Re: Re: Re: R

Re: [sqlite] UI question

2007-08-05 Thread John Stanton
John wrote: John wrote: Griggs, Donald wrote: Regarding: " Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have

Re: [sqlite] QT4 ubuntu sqlite driver problem ? (was Re: [sqlite] Weird error)

2007-08-05 Thread John Stanton
Alain Bertrand wrote: Joe Wilson a écrit : --- Alain Bertrand <[EMAIL PROTECTED]> wrote: > --- Alain Bertrand <[EMAIL PROTECTED]> wrote: In a Qt4 application, I have the following bit of code : QString s; bool b; QSqlQuery q; QSqlError err; s= "CREATE TABLE ttd_bdat

Re: [sqlite] Re: Re: Re: Re: Re: Re: Re: How does SQLite choose the index?

2007-08-05 Thread John Stanton
We learn mathematics etc so that we can make numerical models which give us design information. Imagine trying to build every combination of a bridge to settle on a design! Make a mathematical model and get it close to optimal at the first attempt. RB Smissaert wrote: Yes, I suppose you are

Re: [sqlite] Re: Re: Re: Re: Re: Re: How does SQLite choose the index?

2007-08-05 Thread John Stanton
RB Smissaert wrote: But then if the base of the logarithm doesn't matter then how is this equation going to help you? m==N/logN So, basically it comes down to some experimenting? RBS No, the relationship is set by the math. An absolute measurement requires that you experiment to discover th

Re: [sqlite] UI question

2007-08-03 Thread John Stanton
Joe Wilson wrote: --- [EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. To reproduce: 1. b

Re: [sqlite] Re: Re: Re: how do i declare and use variables in sqlite?

2007-08-03 Thread John Stanton
Igor Tandetnik wrote: Paul Harris <[EMAIL PROTECTED]> wrote: anyway, this is what i'm trying to do: eg 1 select @somevar := column1 from table1; update table2 set column2 = @somevar; update table2 set column2 = (select column1 from table1); Igor Tandetnik A note to the original poster.

Re: [sqlite] Re: Re: how do i declare and use variables in sqlite?

2007-08-03 Thread John Stanton
Paul Harris wrote: On 03/08/07, Nikola Miljkovic <[EMAIL PROTECTED]> wrote: [In the message "Re: [sqlite] Re: Re: how do i declare and use variables in sqlite?" on Aug 3, 11:47, "Paul Harris" writes:] create temporary table vars (name text, value something); -- insert into vars set name="x",

Re: [sqlite] UI question

2007-08-02 Thread John Stanton
It seems to be connected with xterm. Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. To reproduce: 1. build sqlite3 without readline support.

Re: [sqlite] UI question

2007-08-02 Thread John Stanton
Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. Chris Peachment wrote: On Thu, 02 Aug 2007 08:21:30 -0600, Scott Derrick wrote: This is probably a stupid question but has frustrated me a couple of times. When usin

Re: [sqlite] UI question

2007-08-02 Thread John Stanton
It is a bug in sqlite3. You can kill the process from another channel or supend it with a CTL Z and then kill it locally. Scott Derrick wrote: This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have f

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-08-01 Thread John Stanton
y. i'm gusiness you are talking about the sqlite3.dll. What is hte procedure to link it ? it seems to me that as long as I have an include to , I need to have that file on my PC somewhere. Stephen John Stanton wrote: You don't have to include the Sqlite source to use DevC0++. Just include

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-08-01 Thread John Stanton
nk it ? it seems to me that as long as I have an include to , I need to have that file on my PC somewhere. Stephen John Stanton wrote: You don't have to include the Sqlite source to use DevC0++. Just include the link library. Stephen Sutherland wrote: Hi; I'm pretty much a n

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-08-01 Thread John Stanton
s to me that as long as I have an include to , I need to have that file on my PC somewhere. Stephen John Stanton <[EMAIL PROTECTED]> wrote: You don't have to include the Sqlite source to use DevC0++. Just include the link library. Stephen Sutherland wrote: Hi; I'm prett

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-07-31 Thread John Stanton
You don't have to include the Sqlite source to use DevC0++. Just include the link library. Stephen Sutherland wrote: Hi; I'm pretty much a newbie. I'm just about finishing a PC a game with Dev C++. I decided to use sqlite3 to load content from XML repository (for user write access) into the

Re: [sqlite] CREATE INDEX that is case insensitive?

2007-07-30 Thread John Stanton
Lower case and upper case are different, with lower case having the higher vlaue. To get case insensitive sorts do this: CREATE TABLE mytab (a TEXT COLLATE NOCASE); then SELECT a FROM mytab ODRER BY a; will give a case insensitive sorted list. Chase wrote: ok. here's a SELECT that w

Re: [sqlite] CREATE INDEX that is case insensitive?

2007-07-30 Thread John Stanton
It is in correct order. You might try COLLATE NOCASE to force an uper case only sort. Chase wrote: Right now, when i do a select in sqlite that is supposed to be in alphabetical order, i get: DC Da De Do instead of: Da DC De Do The LIKE operator doesn't seems to be helping me here ei

Re: [sqlite] How to know which rows are affected by UPDATE/DELETE?

2007-07-30 Thread John Stanton
You should take a closer look at the structure of Sqlite, in particular how it uses pages. It is not amenable to your row locking strategy. Gilles Ganault wrote: Hello To write a front-end server to SQLite. To avoid locking the whole database, I'd like to implement optimistic locking, but fo

Re: [sqlite] shared cache/ test_server.c

2007-07-27 Thread John Stanton
Scott Hess wrote: On 7/27/07, John Stanton <[EMAIL PROTECTED]> wrote: Scott Hess wrote: On 7/26/07, Richard Klein <[EMAIL PROTECTED]> wrote: According to the Mozilla article referenced above, it's even worse than that: *All* cache pages, dirty or not, are freed at

Re: [sqlite] shared cache/ test_server.c

2007-07-27 Thread John Stanton
Scott Hess wrote: On 7/26/07, Richard Klein <[EMAIL PROTECTED]> wrote: According to the Mozilla article referenced above, it's even worse than that: *All* cache pages, dirty or not, are freed at the end of *every* transaction, even if the transaction consisted of only read operations. I bel

Re: [sqlite] shared cache/ test_server.c

2007-07-27 Thread John Stanton
Richard Klein wrote: John Stanton wrote: Richard Klein wrote: Joe Wilson wrote: You've probably read this. It's useful information for any performance minded developer using SQLite: http://developer.mozilla.org/en/docs/Storage:Performance >> [snip] If the abov

Re: [sqlite] shared cache/ test_server.c

2007-07-26 Thread John Stanton
Richard Klein wrote: Joe Wilson wrote: You've probably read this. It's useful information for any performance minded developer using SQLite: http://developer.mozilla.org/en/docs/Storage:Performance I read it, and I'm now weeping! Below I've reproduced the paragraphs that cause me some c

Re: [sqlite] shared cache/ test_server.c

2007-07-26 Thread John Stanton
I read that. The Mozilla people point out that their advantage was with a large volume of small transactions. They benefit from not destroying the cache between transactions and by conserving memory with large numbers of users. They point out that relaxing the ACID requirements also aids thr

Re: [sqlite] shared cache/ test_server.c

2007-07-25 Thread John Stanton
tting at with the locking. Indeed handling locking internally in memory will always be faster (assuming speed of ram access is faster than disk I/O). John Stanton <[EMAIL PROTECTED]> wrote: I think that you misunderstood the shared cache description. Cache is shared by many connections b

Re: [sqlite] shared cache/ test_server.c

2007-07-24 Thread John Stanton
be totally off my rocker.. and thats ok too. Ken John Stanton <[EMAIL PROTECTED]> wrote: That is why the Sqlite locking is not a good fit for a threaded server. Why not use thread locks instead and achieve the synchronization with minimum overhead and latency? You do miss out on

Re: [sqlite] shared cache/ test_server.c

2007-07-23 Thread John Stanton
That is why the Sqlite locking is not a good fit for a threaded server. Why not use thread locks instead and achieve the synchronization with minimum overhead and latency? You do miss out on a couple of Sqlite features doing that (the pending and reserved locks which help with concurrency and

Re: [sqlite] shared cache/ test_server.c

2007-07-20 Thread John Stanton
next in the queue will be serviced. I favored option b. Since it caused less thrashing about when the client intiated a read request or another transaction request when a transaction was already in progress. Hope that helps. John Stanton <[EMAIL PROTECTED]> wrote: Ken

Re: [sqlite] shared cache/ test_server.c

2007-07-20 Thread John Stanton
in <[EMAIL PROTECTED]> wrote: Richard Klein wrote: [EMAIL PROTECTED] wrote: John Stanton wrote: Yes, each connection has a cache. A lot of concurrent connections means a lot of memory allocated to cache and potentially a lot of duplicated cached items. See shared cache mode for

Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread John Stanton
You don't seem to have the sqlite3 link library in your compile and link command. MaaSTaaR wrote: Hello ... firstly, sorry for my bad English. i am using SQLite with C under Linux, i wrote small file which use Glade, GTK and SQLite, but i have problem with SQLite. this is the command which i

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
Richard Klein wrote: John Stanton wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. > Why is that? Is there a separate cache (I hope not!) for each connection? Thanks, - Richard

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread John Stanton
[EMAIL PROTECTED] wrote: > A single connection can only be used by a single thread at > a time. If you have multiple threads running at the same > time, they each need to have their own connection. > > If you are not running on a Linux 2.4 kernel, then you can > pass connections from one thread

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread John Stanton
[EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. As far as we can ascerta

Re: [sqlite] sorting of blobs

2007-07-18 Thread John Stanton
Well done, you have answered the man's question. Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Try looking at the SORT opcode. You can track it through the Sqlite source. OP_Sort doesn't sort any longer. It just does a rewind on the cursor. /* Op

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. As far as we can ascertain avoiding fcntl removes any issues regarding multi

Re: [sqlite] "Library routine called out of sequence" and user-defined aggregates

2007-07-18 Thread John Stanton
Have you checked to ensure that you database handle is correct? Your function inherits it as user data, but is it corrupted? [EMAIL PROTECTED] wrote: I'm getting "Library routine called out of sequence" when I try to execute an insertion inside an aggregate that I have created myself. Here

Re: [sqlite] sorting of blobs

2007-07-18 Thread John Stanton
B V, Phanisekhar wrote: Assume I have an albumtable: create table albumtable (albumid INTEGER PRIMARY KEY, album BLOB); Now I do a query to return the entire albums in the albumtable table in alphabetical order: The instructions for the above query are given below: explain select

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
In our particular application we use Sqlite embedded in a multi-threaded application server. The databases are only accessed by that process. We compile Sqlite without the fcntl file locking and place a pthread read/write lock around accesses to the connection for each database. That way we ha

Re: [sqlite] Re: UPDATE during SELECT

2007-07-17 Thread John Stanton
We implement pthread read/write locks around Sqlite in a multi-threaded environment and disable the fcntl file locking and ignore busy logic. It has the downside of losing some concurrency compared to the Sqlite pending and reserved lock strategy, but we have not suffered a performance hit yet.

Re: [sqlite] Finding record position

2007-07-17 Thread John Stanton
First, think about using FTS2 for your text lookup instead of using LIKE and having to perform row scans. Think about changing your logic to just read from the database instead of blowing out your memory by holding the database on disk, then in disk cache and again in application memory. If y

Re: [sqlite] FTS2

2007-07-14 Thread John Stanton
Uma Krishnan wrote: Downloading SQLite source does not come with FTS2 source? If not, how do I download FTS2 source. I see only a way to download binary. Thanks in advance Uma Look in the CVS archive. Everything is there. ---

Re: [sqlite] Sharing an in-memory database between applications

2007-07-14 Thread John Stanton
Since Sqlite caches data in memory you are unlikely to achieve spectacular improvements by having the database memory resident. Perhaps you could investigate performing pre-processing of your data to reduce the time it takes to render your graph. Rob Richardson wrote: Greetings! We are using

Re: [sqlite] Milliseconds

2007-07-14 Thread John Stanton
Christian Smith wrote: John Stanton uttered: The Sqlite date/time routimes have a resolution to seconds, not milliseconds. If you want milliseconds from SQL implement your own user defined functions which give you milliseconds. You would access the time functions using the API of the

Re: [sqlite] Replicating table data from sqlite to ms sql server

2007-07-14 Thread John Stanton
You can write a program which uses the Sqlite API to read the Sqlite database and the Sql Server API to write to Sql Server. maitong uy wrote: I see...any idea as to how exactly? I really am out of ideas regarding this... :( John Stanton wrote: Everything is possible programatically. You

Re: [sqlite] Milliseconds

2007-07-12 Thread John Stanton
The Sqlite date/time routimes have a resolution to seconds, not milliseconds. If you want milliseconds from SQL implement your own user defined functions which give you milliseconds. You would access the time functions using the API of the underlying OS. You might choose to implement your un

Re: [sqlite] Replicating table data from sqlite to ms sql server

2007-07-10 Thread John Stanton
has its own web server. Can this still be possible? It's more of like having a server to server communication. Is this programmatically possible? John Stanton wrote: You could register a trigger and write a user function which reads the row you just inserted, updated or deleted and writes

Re: [sqlite] How to implement connection pooling

2007-07-10 Thread John Stanton
We use connection pooling. It took only a few lines of C code to implement. In our case we maintain a global list of open connections and access them by pathname. A mutex is required to protect the list anchor pointer when a new connection is added. We also add pthread read/write locking to

Re: [sqlite] storing floating point values in field

2007-07-10 Thread John Stanton
You seem to be looking at the output of the floating point to ASCII function in the Sqlite command line shell program, not the floating point number itself. folabi wrote: Thanks for the feedback Chris I ran the sqlite3.exe on the command line and got the same results as you did. I consume th

Re: [sqlite] Replicating table data from sqlite to ms sql server

2007-07-10 Thread John Stanton
You could register a trigger and write a user function which reads the row you just inserted, updated or deleted and writes it to the othe DB. The user installed Sqlite function can inherit the open database connection as userdata. maitong uy wrote: Hello there, I'm new to sqlite and I was

Re: [sqlite] CREATE TABLE

2007-07-06 Thread John Stanton
Are you execduting several sqlite3_prapare and sqlite3_step statements? The prepare steps through the statements returning a pointer to the start of the next one as one is compiled. Ryan M. Lederman wrote: I'm using sqlite3, built with Microsoft's CL compiler, 8.0 on a Windows Mobile platform

Re: AW: [sqlite] Re: In Mem Query Performance

2007-07-03 Thread John Stanton
Using run length encoding on your keys is an ingenious approach. Another idea would be to reverse the keys so the significant chars are first. Splitting keys to produce the effect used in prefix b-trees cold also be an option. Michael Ruck wrote: As has been suggested numerous times, you sho

Re: [sqlite] Re: In Mem Query Performance

2007-07-01 Thread John Stanton
It looks as if you would do better to run your job as one or more transactions and to use the Sqlite API, with the sequence: sqlite3_prepare begin transaction loop sqlite3_bind sqlite3_step sqlite3_reset end

Re: [sqlite] FW: BLOB data retrieval

2007-06-27 Thread John Stanton
Krishnamoorthy, Priya (IE10) wrote: Hi, I have a database which has a table that contains BLOB data. The table has two columns - one is "Row_Num" which is of type AUTO_INCREMENT (INTERGER_PRIMARY_KEY) and the other column "Data" contains BLOB data. I am writing a program (in MS VC++) wh

Re: [sqlite] querying number of open connections

2007-06-27 Thread John Stanton
Nate Constant wrote: Hello, is there a way to query the number of open database connections? An open file monitor like lsof will do it. - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Alternative index methods (hash key)

2007-06-20 Thread John Stanton
Andrew Finkenstadt wrote: On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Scott Hess" <[EMAIL PROTECTED]> wrote: > On 6/20/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: > > How difficult do you think it would be to support an alternative method of > > indexing within SQLite speci

Re: [sqlite] Data structure for versioned data

2007-06-20 Thread John Stanton
We perform some versioning by holding column material in XML and using RCS to maintain reverse deltas and versions. Samuel R. Neff wrote: Not specific to SQLite, but we're working on an app that needs to keep versioned data (i.e., the current values plus all previous values). The versioning is

Re: [sqlite] Recommend server for Windows?

2007-06-20 Thread John Stanton
Gilles Ganault wrote: At 20:47 19/06/2007 -0500, John Stanton wrote: Such a server can be made simpler then mine by making it single threaded. Is it publicly available from http://www.viacognis.com? Thanks G. No, but I can give you some code which might help your project. The components

Re: [sqlite] Recommend server for Windows?

2007-06-19 Thread John Stanton
Gilles Ganault wrote: At 16:49 19/06/2007 -0700, Medi Montaseri wrote: While its difficult to tell what the problem statement (or context) is, but the ingrediants like HTTP and POST spells SOAP. The context is that, until now, our apps were almost used on stand-alone hosts with only a few c

Re: [sqlite] Recommend server for Windows?

2007-06-19 Thread John Stanton
Gilles Ganault wrote: At 11:20 19/06/2007 -0400, Clay Dowling wrote: I'm going to recommend PostgreSQL. Thanks for the idea, but if possible, we'd rather something really basic, typically a single EXE. Besides, using eg. PostgreSQL would require rewriting our application. I went throug

[sqlite] Database Design

2007-06-19 Thread John Stanton
Just some observations after reading mail on this forum. It is wise when using Sqlite to design your database and application to work to the strengths, not weaknesses of Sqlite. Be aware that Sqlite only uses one index per table in a query and that it's cache is tied to a connection. If you

Re: [sqlite] Custom Aggregation Not Working

2007-06-19 Thread John Stanton
We have implemented a decimal arithmetic module to handle money in Sqlite. It uses the regular SQL definitions and maintains precison and scale. The data are stored as TEXT and in "display format", right aligned with leading spaces so that they display without editing or radix transformation

Re: [sqlite] FTS2 Experiences?

2007-06-18 Thread John Stanton
We have just started to use it. So far it is performing well, but we have not subjected it to high volume and large data sets yet. I have written a simple function which helps in our application. The function concanenates columns to produce a block of text then strips out punctuation and pre

Re: [sqlite] Proper way to transfer a live sqlite database

2007-06-18 Thread John Stanton
One of the most endearing features of Sqlite is that it is a single file. You can copy it with impunity. If it is in use while you are copying you can launch an exclusive transaction to block other users and copy it and be assured of its state. Rich Rattanni wrote: The databases will be in

Re: [sqlite] SQLITE_CORRUPT recover

2007-06-18 Thread John Stanton
with mutexes. The logic is very simple. Sabyasachi Ruj wrote: I still fail to understand what should I synchronize on. I am *not* sharing sqlite* across multiple threads. On 6/18/07, John Stanton <[EMAIL PROTECTED]> wrote: It is fundamental computer science, CS101 you might say. Pick up

Re: [sqlite] SQLITE_CORRUPT recover

2007-06-18 Thread John Stanton
It is fundamental computer science, CS101 you might say. Pick up a textbook on basic computing. Sabyasachi Ruj wrote: But can you tell me where is this documented please? On 6/18/07, John Stanton <[EMAIL PROTECTED]> wrote: If you knew the answer then why did you ask the question? Y

Re: [sqlite] Trigger update of multiple columns

2007-06-18 Thread John Stanton
If you can automatically enter data then you are violating the normalization rules. Maybe you should get a book on database design and become familiar with some of the fundamentals. T&B wrote: Hi John, You have a reference data set which is accessed to get the current value of reference el

Re: [sqlite] SQLITE_CORRUPT recover

2007-06-18 Thread John Stanton
nternally does if it is compiled with THREADSAFE=1. > > On 6/18/07, John Stanton <[EMAIL PROTECTED]> wrote: > >> >> The problem is fairly straight forward. Sqlite is a single resource >> being shared by multiple thyreads so you just use fundamental >&g

Re: [sqlite] Trigger update of multiple columns

2007-06-18 Thread John Stanton
I mean something else. You have a reference data set which is accessed to get the current value of reference elements and store transactions to record events. The transaction trails provide event history. A price is in the reference data, its value transferred to a transaction is no longer a

Re: [sqlite] SQLITE_CORRUPT recover

2007-06-18 Thread John Stanton
6/18/07, John Stanton <[EMAIL PROTECTED]> wrote: The problem is fairly straight forward. Sqlite is a single resource being shared by multiple thyreads so you just use fundamental synchronization logic as you would when sharing any resource between competing threads. Sabyasachi Ruj wrote

Re: [sqlite] SQLITE_CORRUPT recover

2007-06-18 Thread John Stanton
The problem is fairly straight forward. Sqlite is a single resource being shared by multiple thyreads so you just use fundamental synchronization logic as you would when sharing any resource between competing threads. Sabyasachi Ruj wrote: Hi, I am using sqlite in a multithreaded environmen

Re: [sqlite] Trigger update of multiple columns

2007-06-18 Thread John Stanton
A general rule of database design is to seperate reference and transactional data. Then you can have a normalized database in a dynamic environment. T&B wrote: Hi Puneet and John, You each respectively said: Why are you repeating the Code, Buy, Sell, and Description columns in the Sale_Pr

Re: [sqlite] Journal File Optimization

2007-06-18 Thread John Stanton
Andre du Plessis wrote: How can one optimize the creation of the journal file. The problem is this, for our system which is an event based one each message needs to be insterted and committed to the database (guaranteed), this results in a commit per insert, this was obviously unacceptably slow a

Re: [sqlite] Trigger update of multiple columns

2007-06-18 Thread John Stanton
A traditional goal in database design is to place data in "Third Normal Form" which means in essence that each data element is only stored in one place. Acesses join the rows to deliver data. A normalized database does not hold redundant data and changing the value of one element changes its

Re: [sqlite] Trigger update of multiple columns

2007-06-17 Thread John Stanton
You would have a better database if you normalize it and not do what you propose. T&B wrote: Hi All, I have a pretty standard sales tracking database consisting of tables: Products - Each row is a product available for sale. Includes fields: Code, Buy, Sell, Description

Re: [sqlite] MMap On Solaris

2007-06-14 Thread John Stanton
calls to "read" but I thought that maybe MMAP might give better performance especially if the OS would just provide the written buffers performed by Process A to Process B's address space that is MMAPed. Thanks for any guidance. Ken John Stanton <[EMAIL PROTECTED]> w

Re: [sqlite] How can I convert from Julian time to a tm structure?

2007-06-14 Thread John Stanton
We just lifted the routines out of Sqlite to do that. They are in date.c. By making an Sqlite-style date type and a small library of date manipulation routines we move date conversion to the application. It is handy when handling ISO8601 and HTTP date formats plus integrating with file agees

Re: [sqlite] MMap On Solaris

2007-06-13 Thread John Stanton
a good point that the vm page fault is probably faster than the overhead of copying the data to a local buffer. So, page fault or not, I think that's the way I'm going to do it. Again, thanks very much for your input! On 6/12/07, John Stanton <[EMAIL PROTECTED]> wrote: Mitche

Re: [sqlite] MMap On Solaris

2007-06-12 Thread John Stanton
Mitchell Vincent wrote: Working with some data conversion here (that will eventually go into an SQLite database). I'm hoping you IO wizards can offer some help on a question that I've been trying to get answered. I'm using Solaris 10 for this. If I mmap a large file and use madvise with MADV_SE

Re: [sqlite] Database replication question

2007-06-12 Thread John Stanton
[EMAIL PROTECTED] wrote: - Original Message From: Joe Wilson <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Monday, June 11, 2007 8:36:32 PM Subject: Re: [sqlite] Database replication question Large bulk inserts with more than one index (implicit or explicit) is not SQLite's st

Re: [sqlite] Re: Why is there no sqlite3_exec16() method?

2007-06-11 Thread John Stanton
You can keep the prepared SQl and re-use it by using sqlite3_reset. Rob Richardson wrote: Igor, Thank you very much for your reply. My naïve impression was that sqlite3_prepare/step/finalize are used for SELECT statements, where there would be a result set one would want to step through, and t

Re: [sqlite] Truncate Issue

2007-06-07 Thread John Stanton
If you don't truncate a file then you may have untruncated files. Why can't you truncate a file? It is implemented one way or another on pretty much every OS. Sqlite uses truncate in it b-tree logic and probably elsewhere so you would very likely encounter problems with no truncate. Jimmy

Re: [sqlite] Syntax help with UPDATE in SQLite Database Browser

2007-06-07 Thread John Stanton
You don't seem to be positioning on a row in the Parameter table with a WHERE clause. Ellis Robin (Bundaberg) wrote: Could I please get some help on the syntax required to perform my UPDATE based on a selection from multiple tables? I've been through the archives but can't seem to make much sen

Re: [sqlite] Re: Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?

2007-06-07 Thread John Stanton
Igor Tandetnik wrote: John Stanton <[EMAIL PROTECTED]> wrote: Predictability is ensured by using transactions. By using BEGIN and COMMIT to make transactions atomic you enforce a predictable state. Not if you modify the same data you are iterating over, on the same DB connection an

Re: [sqlite] FTS-2

2007-06-07 Thread John Stanton
Scott Hess wrote: On 6/7/07, John Stanton <[EMAIL PROTECTED]> wrote: I have just started to use FTS2 and it is working well but I would like to ask any other users if they have had good or bad experiences and why they would use FTS2 rather than FTS1. The software is new and I have no

[sqlite] FTS-2

2007-06-07 Thread John Stanton
I have just started to use FTS2 and it is working well but I would like to ask any other users if they have had good or bad experiences and why they would use FTS2 rather than FTS1. The software is new and I have not seen any feedback at this stage and we are yet to apply large data sets and h

Re: [sqlite] Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?

2007-06-07 Thread John Stanton
Predictability is ensured by using transactions. By using BEGIN and COMMIT to make transactions atomic you enforce a predictable state. B V, Phanisekhar wrote: Thanks Igor, Why it's unpredictable? Why can't the unpredictable be made predictable? Assume I update the column of a row that

<    1   2   3   4   5   6   7   8   9   10   >