Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-06 Thread Jay Sprenkle
I do it by maintaining a column named 'SortOrder' You can update the field to have whatever content will get you the order you want at the moment and it's preserved the next time they start the application. On 1/6/07, Sean Payne <[EMAIL PROTECTED]> wrote: Suppose gui-users wanted to drag and

Re: [sqlite] Shared cache mode issue

2007-01-08 Thread Jay Sprenkle
On 1/8/07, Peter James <[EMAIL PROTECTED]> wrote: Thanks for your response, Ken. I'm not sure I've explained myself properly. It's not that I'm calling sqlite3_enable_shared_cache() multiple times. It's that if I don't maintain a persistent connection while the server is running I end up with

Re: [sqlite] multiuser DB on network share

2007-01-09 Thread Jay Sprenkle
I've heard this too. Windows networking has some issues with locking. You might research 'oplocks' or 'opportunistic locking' (or opportunistic caching) if you're interested in understanding what it's doing. I was reading it the other day and thought it might be the key to making it work

Re: [sqlite] multiuser DB on network share

2007-01-09 Thread Jay Sprenkle
Oplocks do not break things. Oplocks will guarantee consistency. They are granted when only one client OS has a file open letting that client OS perform locking and caching operations internally without consulting the server each time. If another client wants to open the file, then that second

Re: [sqlite] multiuser DB on network share

2007-01-10 Thread Jay Sprenkle
On 1/10/07, Nuno Lucas <[EMAIL PROTECTED]> wrote: > How is the first client 'contacted' and asked to respond? > I can't see how this is anything but useless. I can't imagine very many > programs honor this kind of request since I've never even heard of this > before last week. If the first

Re: [sqlite] multiuser DB on network share

2007-01-10 Thread Jay Sprenkle
> How is the first client 'contacted' and asked to respond? > I can't see how this is anything but useless. I can't imagine very many > programs honor this kind of request since I've never even heard of this > before last week. If the first client doesn't respond to the request > it would have to

Re: [sqlite] How to optimize a select that gets 17 rows from a 700k row DB (via perl using DBI)?

2007-01-13 Thread Jay Sprenkle
Have you considered running a process that summarizes the data from the table and just fetching the last summary for display? Will a periodic snapshot work for your reporting or do you need realtime summarization? On 1/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi all. I will try to

Re: [sqlite] Re: How to optimize a select that gets 17 rows from a 700k row DB (via perl using DBI)?

2007-01-14 Thread Jay Sprenkle
On 1/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Jay: The closer to real-time, the better. The most often a cron job can run under Linux is minutely, and minutely is pretty good. I guess I could have the summary process occur at the end of the script that polls the machines. It

Re: [sqlite] Re: does select reliably return insert order?

2007-01-21 Thread Jay Sprenkle
On 1/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If you use LIMIT/OFFSET without an > explicit ORDER BY, you are relying on an implementation detail. Yes, but SQLite is an implementation. If it returns rows allways in the same order I don't see why it shouldn't be acknowledged - one

Re: [sqlite] Shared Lock Transactions

2007-01-21 Thread Jay Sprenkle
On 1/21/07, Andrew Teirney <[EMAIL PROTECTED]> wrote: I appologise in advance if this is not the correct place to post this query ... I was just wondering whether there might be any particular reason why there doesn't appear to be support for creating transactions that acquire a shared lock on

Re: [sqlite] Shared Lock Transactions

2007-01-21 Thread Jay Sprenkle
On 1/21/07, Andrew Teirney <[EMAIL PROTECTED]> wrote: > What is a 'shared' lock? You can't share a lock, only one process can > own it > at a time. > As per this document http://www.sqlite.org/lockingv3.html SHARED The database may be read but not written. Any number of processes can hold

Re: [sqlite] Shared Lock Transactions

2007-01-21 Thread Jay Sprenkle
On 1/21/07, Andrew Teirney <[EMAIL PROTECTED]> wrote: > > > What is a 'shared' lock? You can't share a lock, only one process can > > own it > > at a time. > > > > As per this document > > http://www.sqlite.org/lockingv3.html > > SHARED The database may be read but not written. Any number of >

Re: [sqlite] Do I need to use sqlite3_close after a failed sqlite3_open?

2007-01-24 Thread Jay Sprenkle
On 1/24/07, Jef Driesen <[EMAIL PROTECTED]> wrote: Do I need to use sqlite3_close if the call to sqlite3_open indicated an error? The documentation for sqlite3_open says "An sqlite3* handle is returned in *ppDb, even if an error occurs." So I assumed the answer is yes. I never do, since if

Re: [sqlite] Dumb Newbie Question - Comparison if sqlite index to STL

2007-01-25 Thread Jay Sprenkle
On 1/25/07, Ben Supnik <[EMAIL PROTECTED]> wrote: Hi Y'all, Please forgive what I think is probably a dumb question, but... I am porting my app's data model from C++/STL to sqlite. My goal is scalability - even if I implement my data model in C++ using data structures that give me good O(N)

Re: [sqlite] selecting a random record from a table

2007-01-26 Thread Jay Sprenkle
On 1/25/07, P Kishor <[EMAIL PROTECTED]> wrote: 1. given a non-sequential id, select all the ids 2. grab a random id 3. select the row with that id. is there a better way of accomplishing this, one that requires a single round-trip to the db? There's always the random shuffle method. add a

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Jay Sprenkle
On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: The pseudo-random number generator (PRNG) in SQLite is becoming more important so it seem good to make sure it is well seeded. I'd like to be able to seed the random number generator so I can have repeatable sequences of random numbers

Re: [sqlite] Abuse of the SQLite website

2007-01-31 Thread Jay Sprenkle
On 1/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Last night, a single user (or, at least, a single IP address) in China that self-identified as running windows98 and Mozilla 4.0 attempted to download sqlite-3.3.12.tar.gz 24980 times and sqlite-source-3_3_12.zip 25044 times over about a

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Jay Sprenkle
On 1/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Please pick a pseudo algorithm of your choice and give us the ability to > seed it? > You already have this capability. Use the redefinably I/O feature to insert your own random number seeder in place of the one that comes built in.

Re: [sqlite] sqlite core function question

2007-02-02 Thread Jay Sprenkle
On 1/31/07, T <[EMAIL PROTECTED]> wrote: or better yet, I expected this to work, using the modulo operator %: SELECT x - x % 1; Isn't that evaluated left to right? x-x = 0 0 %1 = 0 -- -- The PixAddixImage Collector suite: http://groups-beta.google.com/group/pixaddix SqliteImporter and

Re: [sqlite] two process problem

2007-02-03 Thread Jay Sprenkle
On 2/3/07, Tom Shaw <[EMAIL PROTECTED]> wrote: I have 2 processes running one is updating portions of a table and one is inserting. Are you using threads? There are some issues using the same database handle with multiple threads. -- -- The PixAddixImage Collector suite:

Re: [sqlite] PS Re: [sqlite] two process problem

2007-02-03 Thread Jay Sprenkle
I have 2 processes running one is updating portions of a table and >>one is inserting. > > >Are you using threads? There are some issues using the same database handle >with multiple threads. Each process is single threaded. Your error messages don't look familiar. What language are you

Re: [sqlite] Extension functions for SQLite in C for free

2007-02-06 Thread Jay Sprenkle
Thanks for sharing MIkey. On 2/6/07, Mikey C <[EMAIL PROTECTED]> wrote: Hi, I've had these functions hanging around for some time. They are not fully tested and come with no warranty of fitness, but if anyone wants the code, please take it.

Re: [sqlite] Select and deletion

2007-02-07 Thread Jay Sprenkle
On 2/7/07, DragonK <[EMAIL PROTECTED]> wrote: Hello everybody, I'm wondering if the following scenario would work properly: Run a SELECT query on the database and in a loop retrieve each result; for each retrieved result, inside the same loop, execute a DELETE statement for the previously

Re: [sqlite] how can i speed up inserts ?

2007-02-07 Thread Jay Sprenkle
On 2/7/07, ohadp <[EMAIL PROTECTED]> wrote: luckily this isn't mission critical failure, i'll take the risk that one out of ten thousand users experiences database corruption. i can only batch the inserts into maybe 4-5 a time, don't know how much of an improvement that will be... If

Re: [sqlite] Select and deletion

2007-02-07 Thread Jay Sprenkle
On 2/7/07, DragonK <[EMAIL PROTECTED]> wrote: This seems to work... but I'm not sure if it should, that's why I'm asking. I hope the code will show more exactly what I intend to do. Sorry for the lack of proper error checking, it's just a test program. :) Also, I'm not using any transactions,

Re: [sqlite] Select and deletion

2007-02-08 Thread Jay Sprenkle
On 2/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Perhaps what Jay did occurred before [3355] (first released with 3.3.8) and what DragonK did occurred afterwards. http://www.sqlite.org/cvstrac/chngview?cn=3355 That explains it. You have a phenomenal memory for detail! -- The

Re: [sqlite] reusing prepared queries or dynamic generation of SQL?

2007-02-10 Thread Jay Sprenkle
On 2/10/07, Brodie Thiesfield <[EMAIL PROTECTED]> wrote: Hi, I'm looking for some SQL advice. I have a query which is used as the base of a filter. At the moment I am using: SELECT * FROM table WHERE (1=? OR foo=?); The actual query is more complex and uses multiple of the constructions in

Re: [sqlite] converting 1,234,567 to a number

2007-02-10 Thread Jay Sprenkle
On 2/10/07, T <[EMAIL PROTECTED]> wrote: Hi all, I have some imported data, where some fields contain numbers with commas denoting thousands separators. How can I change these to actual numbers? If you're using unix or linux there are very nice tools for cleaning up the data before loading

Re: [sqlite] Need help on build query.

2007-02-12 Thread Jay Sprenkle
On 2/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Igor is correct - you cannot do that now. But I have sometimes wondered if it would be nice to add an exec() function to SQLite that would recursively invoke its argument as an SQL script. For example: SELECT exec('DELETE FROM ' ||

Re: [sqlite] query on match between application and sqlite

2007-02-20 Thread Jay Sprenkle
On 2/19/07, Eric S. Johansson <[EMAIL PROTECTED]> wrote: The application is an experimental anti-Spam testbed exploring the use of reputation through proof for puzzles and user interaction. The list of things I'm tracking is fairly significant (for me) and I'm trying to pull things together.

Re: [sqlite] (newbie) pictures in tables, what's the best way ?

2007-02-23 Thread Jay Sprenkle
On 2/23/07, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, I've started with SQLite, because it's one of the first dbases with a local filessytem without authenciation. It looks great, compared to ini-files. Now I've a basic problem: I've a table, with 10 simple fields and 1 blob field,

[sqlite] database package recommendations?

2007-04-07 Thread Jay Sprenkle
Good morning all, Sorry to spam the sqlite list but I thought this might be the best place to ask. I'm trying to find an (embedded) database package to fill a specific need and wondered if anyone can provide a recommendation? Requirements: * disk based storage * As freaking FAST as possible!

Re: [sqlite] last N records

2007-04-07 Thread Jay Sprenkle
try this: delete from mytable where id not in ( select id from mytable order by id desc limit n ) On 4/7/07, Eric S. Johansson <[EMAIL PROTECTED]> wrote: what is the easiest way to hold on to the last N records and delete all older? I can't figure out the right where expression. -- --

Re: [sqlite] database package recommendations?

2007-04-07 Thread Jay Sprenkle
On 4/7/07, John Stanton <[EMAIL PROTECTED]> wrote: DISAM, a CISAM clone might suit your needs. Thanks John. I'll look into that. :)

Re: [sqlite] Nested SELECT : Alternative syntax please ?

2007-04-08 Thread Jay Sprenkle
Access isn't very compatible with anything else ;) why is the outer select wrapped around the inner query? why not just put the group by on the inner query? SELECT SUM(SomeField) FROM complex query tables here GROUP BY SomeOtherField On 4/8/07, Yannick Létourneau <[EMAIL PROTECTED]> wrote:

Re: [sqlite] Nested SELECT : Alternative syntax please ?

2007-04-08 Thread Jay Sprenkle
On 4/8/07, Jaime Castells <[EMAIL PROTECTED]> wrote: Actually, Jay, I've bumped into cases where you couldn't avoid a nested query. Me too, but usually only in Access. I think the problem in Yannick's query was the attempt to alias a table name. In the above, I alias the field name in

Re: [sqlite] Nested SELECT : Alternative syntax please ?

2007-04-08 Thread Jay Sprenkle
glad you got it to work :) On 4/8/07, Yannick Létourneau <[EMAIL PROTECTED]> wrote: Actually it seems I hadn't tried hard enough ;) I managed to make it work using the following syntax (Thanks to Jay) : SELECT SUM(SomeField) FROM (some complex nested SELECT query) GROUP BY

Re: [sqlite] Re: Nested SELECT : Alternative syntax please ?

2007-04-08 Thread Jay Sprenkle
On 4/8/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Jaime Castells <[EMAIL PROTECTED]> wrote: > Hmm, I think the only time you really can't avoid a nested query is > when you > want to do a grouping function on the result of a grouping function. > Like > count the number of customers who have

Re: [sqlite] What would you suggest?

2007-04-09 Thread Jay Sprenkle
To make a good choice you must consider many things. How are you going to query the data? Do you need sql to perform searches? Do you need sqlite's ACID features? On 4/8/07, Lloyd <[EMAIL PROTECTED]> wrote: Hi, I want to store and retrieve sorted integer (these integers are file offsets). So

Re: [sqlite] Efficiency Question - Value Or Liability for Indexingof This Table?

2008-03-14 Thread Jay Sprenkle
On Fri, Mar 14, 2008 at 5:18 PM, Lee Crain <[EMAIL PROTECTED]> wrote: > I was hoping to make an intelligent choice without taking the time to test > it one way, then the other because I am probably not going to be given > that time. The intelligent choice would be to begin a search for an

[sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
I'm not sure if this counts as a bug or not. SQLite version 3.5.2 Enter ".help" for instructions sqlite> select * from (select user.id from user ) ; 0 1 2 3 4 sqlite> select * from (select user.id from user ) where id=1 ; SQL error: no such column: id sqlite> select * from (select user.id from

[sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
I'm not sure if this counts as a bug or not. SQLite version 3.5.2 Enter ".help" for instructions sqlite> select * from (select user.id from user ) ; 0 1 2 3 4 sqlite> select * from (select user.id from user ) where id=1 ; SQL error: no such column: id sqlite> select * from (select user.id from

Re: [sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
On Fri, Mar 14, 2008 at 5:46 PM, Jonas Sandman <[EMAIL PROTECTED]> wrote: > Isn't proper SQL > > select * from (select user.id from user ) blah where blah.id=1 ; ? >From www.sqlite.org, sql syntax, select statement: sql-statement ::= SELECT [ALL | DISTINCT] result [FROM *table-list*]

Re: [sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
On Fri, Mar 14, 2008 at 5:48 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > select * from (select user.id from user ) where "user.id"=1 > > The resulting column is literally named "user.id", period and all. Thank you Igor, you are probably the world's smartest sqlite pundit! Every time I need

Re: [sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
On Fri, Mar 14, 2008 at 5:57 PM, Richard Klein <[EMAIL PROTECTED]> wrote: > > > > > > > select * from (select id from user where id = 1); > Thanks Richard, but in my particular application I need the where clause outside the subselect. ___ sqlite-users

Re: [sqlite] table names from subselects?

2008-03-14 Thread Jay Sprenkle
On Fri, Mar 14, 2008 at 5:53 PM, Dennis Cote <[EMAIL PROTECTED]> wrote: > > You are aliasing the wrong thing. Try this instead: > >select * from (select user.id as id from user ) where id=1 ; > > If you want the subselect result to have a name then you can do this: > >select * from >

Re: [sqlite] Sqlite catalog - datebase with pictures

2008-03-31 Thread Jay Sprenkle
I wrote something similar, the source might be useful to you: -- The PixAddixImage Collector suite: http://groups-beta.google.com/group/pixaddix ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] setting the timezone on windows xp

2008-10-25 Thread Jay Sprenkle
Hello all, this isn't really an sqlite question but it tangentially touches on it. Please disregard it if it offends. I'm trying to write an atom feed exporter for my sqlite database and I need to export the utc time. My development box, windows xp, insists (both in C and in SQLite) that UTC is

Re: [sqlite] setting the timezone on windows xp

2008-10-26 Thread Jay Sprenkle
> _tsetlocale(LC_ALL, _T("")); > _tzset(); > > HTH > > Doug > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:sqlite-users- > > [EMAIL PROTECTED] On Behalf Of Jay Sprenkle > > Sent: Saturday, October 25, 2008 10:32 AM > &

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Jay Sprenkle
> > > MySql works like you described.. Frankly im surprised Postgres doesn't . > > Id imagine there must be a "continue trnasaction" command or something. > > You can define a 'savepoint' inside a transaction. If something goes > wrong you roll back to the savepoint and continue from there. >

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Jay Sprenkle
> A transactions is exactly like the original poster stated it. > > Assuming all Update, Select, Insert Commands are Atomic. A transaction > allows the user to group a bunch of commands together and state they should > be considered atomic, whereas if there is "a failure", then none of them are

Re: [sqlite] Convert and isnumeric function

2005-05-13 Thread Jay Sprenkle
> All or any, > > Has anyone implemented these as built in functions in sqlite 3? If > not - I was thinking of doing it and submitting to the sqlite.org web site > for submission. The api converts data types for you. Isnumeric might be useful but since the database isn't strongly typed

Re: [sqlite] database table is locked

2005-05-16 Thread Jay Sprenkle
> It's probably not a good idea, because it depends on some > behaviour that is not specified, but I once used a trick > like this to get good performance: > > CREATE TABLE abc(a, b); > UPDATE abc SET b = user2(a, b) WHERE AND user1(a, b); > > SQLite loops through the rows where is true, and >

Re: [sqlite] updating records problem

2005-05-17 Thread Jay Sprenkle
rowid won't work in a multiuser database. It's just the row number within the result set you retrieved. This sort of problem is the reason why people use a unique id field. The database automatically assigns you a number that won't change and isn't shown to the user (they can't change it either).

Re: [sqlite] How to get row numbers in a query?

2005-05-19 Thread Jay Sprenkle
> Is there any way to SELECT out the row number of returned results in a > query? > For example: > > SELECT row_number(), value from some_table; > 1 ValueA > 2 ValueB > 3 ValueC > ... etc ... ?? > > What I really want this for is a query where I am inserting from table A > into table B, and

Re: [sqlite] How to get row numbers in a query?

2005-05-19 Thread Jay Sprenkle
> >Are you sure this is true? The rowid in the source table has no > relationship to the order of the results of the query. You're right. I thought it was the row number of the result set, it's not: D:\temp\convention>sqlite3 test.db SQLite version 3.0.8 Enter ".help" for instructions

Re: [sqlite] How to get row numbers in a query?

2005-05-19 Thread Jay Sprenkle
> So I guess I have to write my own function, "current_row()", using the > sqlite3_create_function() APIs? If you've got a program handling this why don't you just count them as you retrieve them?

Re: [sqlite] How to get row numbers in a query?

2005-05-19 Thread Jay Sprenkle
> >Out of curiosity, why doesn't the idea I proposed work? If there's a > situation where it doesn't work I'd like to know, so I don't try using > it myself should a similar situation arise. :) Sorry, didn't mean to imply it wouldn't. You added this caveat though: > Note however that this

Re: [sqlite] Linux Newbie...

2005-05-19 Thread Jay Sprenkle
> I've used the windows command line SQLite utility > without problems, but the linux version GZ file > doesn't worked in mine tests. I extracted the file > with gunzip, but the binary file doesn't worked. It > can be a very basic problem to an esxperient linux > user, but i couldn't execute the

Re: [sqlite] qualified names in WHERE clause

2005-05-26 Thread Jay Sprenkle
All of the databases I've used required the columns in the order by clause also be present in the result set. It may not be universally true though On 5/26/05, Cronos <[EMAIL PROTECTED]> wrote: > It seems to me that MySQL and PostgreSQL are exhibitting some dubious > guessing behaviour as to

Re: [sqlite] Problem with "installing"

2005-06-08 Thread Jay Sprenkle
Instead of the pragma add the library (.lib) directly to the solution. On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm working normally with lib files, which I include with #pragma > comment(lib, "file.lib"); into my C++ program.

Re: [sqlite] solving the infamous, irritating "database locked" problem

2005-06-09 Thread Jay Sprenkle
I'm not familar with the wrapper you're using, but don't you have a commit without a matching begin? Did you establish a lock on the table before trying to update? Are you updating a table that you currently are reading from? As in: select * from t; for each result update t set field = blah;

Re: [sqlite] Row Locking

2005-06-13 Thread Jay Sprenkle
You can't just lock a portion of the file? I've seen support for it in the past but I never used it. On 6/13/05, Ben Clewett <[EMAIL PROTECTED]> wrote: > Dear D. Richard Hipp and SQLite users, > > I am having problems with concurrency in SQLite. Specifically the > database lock method is

Re: [sqlite] SQLITE_SCHEMA can't happen during transaction, right?

2005-06-13 Thread Jay Sprenkle
It's my understanding once you have an exclusive lock no other process can modify the database and therefore can't trigger a schema change. On 6/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Let's say I start a transaction with either BEGIN IMMEDIATE or BEGIN > EXCLUSIVE, by

Re: [sqlite] Row Locking

2005-06-13 Thread Jay Sprenkle
Doesn't look good for file locking: from: http://www.hackinglinuxexposed.com/articles/20030623.html "Last week I described three locking functions - flock, lockf, and fcntl. These functions, while managed by the Linux kernel, are known as advisory locking mechanisms. Any program which doesn't

Re: [sqlite] Write performance

2005-06-17 Thread Jay Sprenkle
On 6/17/05, Sean Heber <[EMAIL PROTECTED]> wrote: > SQLite write (insert) performance doesn't seem very good to me so I'm > trying to find ways to improve it in my application. I had this idea > so I figured I'd run it past you folks who likely better know how the > db works under the hood. did

Re: [sqlite] Poor performance searching from multiple DBs

2005-06-19 Thread Jay Sprenkle
> > I have to search for field5 in some DB files (30 or more for a total of 50 GB > of space and 150 M of records ). > > The DBs have the same structure. > > I want to find the string (if exist) in all DBs. > > The query is like this: > > > > select * from main where field5= "AABBCCDD";

Re: [sqlite] errors compiling with MS VC++ 6.0

2005-06-19 Thread Jay Sprenkle
Msvc 6 can do this if you use some features of c++, you have an early version, and haven't applied the service packs. You could test for memory errors using memtest86 or something similar (i believe it's memtest86.org?). On 6/18/05, Nuno Lucas <[EMAIL PROTECTED]> wrote: > [18-06-2005 0:54,

Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Jay Sprenkle
On 6/20/05, Yuriy <[EMAIL PROTECTED]> wrote: > 1. Example of the decision > > CREATE TABLE testtable (val text) > CREATE INDEX index_val ON [testtable]([val]); > PRAGMA synchronous = OFF; > > for i:=1 to 1000 do > begin > select * from testable where val=StringN > if val NOT Exist insert

Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Jay Sprenkle
Yes. Sorry, haven't had my morning caffeine yet. ;) On 6/20/05, Will Leshner <[EMAIL PROTECTED]> wrote: > > On Jun 20, 2005, at 7:42 AM, Jay Sprenkle wrote: > > > for i:=1 to 1000 do > > begin tran > > insert or on conflict fail into testtable(val) va

Re: Re: [sqlite] Poor performance searching from multiple DBs

2005-06-20 Thread Jay Sprenkle
> >> I have to search for field5 in some DB files (30 or more >>for a total of > >> 50 GB of space and 150 M of records ). > > >> select * from main where field5= "AABBCCDD"; > > > > > Did you put an index on field5? > > Yes I use: > > CREATE UNIQUE INDEX main_index ON main

Re: [sqlite] Unreachable code in pager.c

2005-06-23 Thread Jay Sprenkle
I counted the parens, and you're right. It's definitely not reachable. > I think the compiler is right. I am not familiar with the sqlite3 source > code, but the break at line 1330 breaks the for() loop at line 1324, NOT > the while() loop at line 1281. Is that as it is intended, or is it a >

Re: [sqlite] a couple notes on cross-compiling sqlite3 for the PPC

2005-06-23 Thread Jay Sprenkle
On 6/23/05, Robert P. J. Day <[EMAIL PROTECTED]> wrote: > p.s. as a side note, the whole point of this exercise is to build a > *really* small footprint DB for an embedded system for which space is > at a premium, and sqlite came highly recommended. > > if anyone has a suggestion as to some

Re: [sqlite] Database opens OK but further calls result in MISUSE

2005-06-24 Thread Jay Sprenkle
> rc = sqlite3_open("test.db", db) > If Not rc=SQLITE_OK > Print("Can't open database "+rc) > sqlite3_close(db) > End > Else > Print("Opened: "+rc) > EndIf > > Print("Errcode: "+sqlite3_errcode(db)) Why are you asking for the error code when you already know there was no error? (

Re: [sqlite] Database opens OK but further calls result in MISUSE

2005-06-24 Thread Jay Sprenkle
> > --- > > rc = sqlite3_open("test.db", db) > > You are not passing the correct arguments to sqlite3_open. The > compiler should have noticed this... > > If you are declaring the variable db like "sqlite3 *db;" you have to > call sqlite3_open like: > rc = sqlite3_open("test.db", ); > > That

Re: [sqlite] Database opens OK but further calls result in MISUSE

2005-06-24 Thread Jay Sprenkle
> Apparently not. The sqlite3_open function was OK, but all the others > weren't - I thought it was the other way around. I sent the email to > the list, went to bed, then when I woke up I knew what was wrong. > Sorry for the trouble. I figure out things in dreams too. > > On the other hand,

Re: [sqlite] Does SQLite have a fulltext search like MySQL?

2005-07-06 Thread Jay Sprenkle
On 7/6/05, Steve O'Hara <[EMAIL PROTECTED]> wrote: > > SQLite doesn't have a free text search capability - the Like and Glob > functions are not free text just simple pattern matching on the scanned > text. Performance is very poor because there is no suitable index. > > It's not a simple task

Re: [sqlite] Mozilla + SQLite?

2005-07-06 Thread Jay Sprenkle
On 7/6/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > On Wed, 2005-07-06 at 08:40 -0700, Scott Baker wrote: > > Looks like Firefox is gearing up to store some of its information in > > SQLite? Does anyone know anything more about this? > > > >

Re: [sqlite] SQLite in memory database from SQLite (3.x) file database?

2005-07-06 Thread Jay Sprenkle
> Is it possible to load an SQLite file database into an SQLite "in > memory" database? If so what is the most efficient method to do this? > I'm looking for the fastest possible performance. Taking out the > disk I/O seems like the way to go. create a memory database, attach the file based

Re: [sqlite] Syntax Help

2005-07-06 Thread Jay Sprenkle
On 7/6/05, Kiel W. <[EMAIL PROTECTED]> wrote: > >set tran_string "BEGIN TRANSACTION\n" > >foreach ... > >append tran_string "\n" > >append tran_string "END TRANSACTION\nCOMMIT TRANSACTION" > >DB eval "$tran_string" > Ray, > Someone may pipe in to correct me, but this is my understanding.. >

Re: [sqlite] Mozilla + SQLite?

2005-07-08 Thread Jay Sprenkle
Thanks for sharing! I'm looking forward to the calendar program.

Re: [sqlite] limiting database size

2005-07-11 Thread Jay Sprenkle
On 7/11/05, Ramon <[EMAIL PROTECTED]> wrote: > I would like to know if there is a way to limit a sqlite database and then be > able > to change this limit later on? Stop inserting when it's full?

Re: [sqlite] Saving "Unsigned Long"s in database

2005-07-12 Thread Jay Sprenkle
On 7/12/05, Gotzon Astondoa <[EMAIL PROTECTED]> wrote: > Hi all: > > I need to make an IP database. They will be stored like "unsigned long" > variables, so, their size will be 4 bytes. > > The IP will be stored in the "domain" field. > The "field type" of domain is NUMERIC. > > I save

Re: [sqlite] Saving "Unsigned Long"s in database

2005-07-12 Thread Jay Sprenkle
> I create the database in this way: > > PRAGMA page_size=4096; > CREATE TABLE domains (group_id NUMERIC, domain NUMERIC); > CREATE INDEX idx_domain ON domains (domain ASC); > > I create an index in domain because i want to make sentences where the WHERE > clause will appear in this

Re: [sqlite] How to delete all rows in table (TRUNCATE) without creating journal file(s)?

2005-07-15 Thread Jay Sprenkle
> Disabling the journal would roughly half the amount > of disk (flash) I/O required. If it currently takes > 2 minutes to delete, disabling the journal would > reduce that to about 1 minutes. Still a long time. You were aware that flash memory has a limited number of write cycles before it

Re: [sqlite] Update command Help....

2005-07-18 Thread Jay Sprenkle
You should post your sql On 7/18/05, Nicholas Choate <[EMAIL PROTECTED]> wrote: > I have noticed a quirk with the Update command and was just wondering if > there was a way to fix it. I am attempting to update two fields in my > database and I've noticed that if there is a ";" in the text

Re: [sqlite] Update command Help....

2005-07-18 Thread Jay Sprenkle
> Put mulitple record into your table and see what > occurs. D:\temp\convention>sqlite3 test.db SQLite version 3.0.8 Enter ".help" for instructions sqlite> create table t (a, b); sqlite> insert into t (a, b) values ('foo', 'bar'); sqlite> insert into t (a, b) values ('test', '2'); sqlite>

Re: [sqlite] order of reception of results at the time of a request SQL

2005-07-20 Thread Jay Sprenkle
> In my application, I call upon the method sqlite3_exec(). This > method returns the results of request SQL in a function: > callback(int argc, char **argv, char **azColName). > This function "callback" displays then the results: > > int i; > for(i=0; i { > printf("%s =

Re: [sqlite] Writing Triggers in C/C++

2005-07-20 Thread Jay Sprenkle
if you write a user defined function and call that from a trigger you could. On 7/20/05, Sudhir Hasbe <[EMAIL PROTECTED]> wrote: > Hi All, > This maybe a strange question to ask but Can I write or call > C/C++ based triggers. I mean either write a trigger in C/C++ or call a C/C++ >

Re: [sqlite] order of reception of results at the time of a request SQL

2005-07-22 Thread Jay Sprenkle
> I have do many tests. It appears that the results of requests > each time are received in the same order. This order is that of > creation of the table. If I have make a CREATE TABLE X (int, char, > int, char), I receive the results of my request SQL in the good order: > int, char, int, char.

Re: [sqlite] Multi-threading.

2005-07-22 Thread Jay Sprenkle
On 7/22/05, Paul G <[EMAIL PROTECTED]> wrote: > > Using Exceptions correctly, I have never felt the need for a GoTo. > > Exceptions do the same as GoTo, accept, maybe, in a slightly more > > developed and useful way. > > then you haven't coded anything complex enough to require them. i can tell

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread Jay Sprenkle
> SQLite Version 3.2.2. > Is this a bug, or is my SQL that bad? > Query 1: > SELECT * FROM table1, table2 > WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); > This query works perfectly, can't fault it. > But when I do this, SQLite locks out (Command line interface, and PHP5)

Re: [sqlite] Multi-threading.

2005-07-25 Thread Jay Sprenkle
> Computer _Science_ is just that: Science. It's not opinion. What they taught me at university was the current collection of "best practices" for solving problems. "Here's a common problem, here are the known good algorithms for solving it. Here are the techniques we use for creating 'good'

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Jay Sprenkle
On 7/25/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Any thoughts/brainstorming would be great from anyone :) > > Personally I don't have much experience with programming a database and > the theory in it. But I suppose that in order to be able to go backward, > the results already

Re: [sqlite] Iterating a result from a query

2005-07-25 Thread Jay Sprenkle
> > I cache the items I'm displaying in an STL vector (C++). If the user moves > > to a page where I have no data I load it from the database as needed. I was > > considering loading data in the background in case the user might need it > > since I can predict what they might do relatively easily.

Re: [sqlite] Index generation efficiency

2005-07-26 Thread Jay Sprenkle
On 7/25/05, Mathieu Blondel <[EMAIL PROTECTED]> wrote: > I found out it is much more efficient to drop all the indexes, do my big > transaction and then recreate all the indexes. Dropping indexes is not a > really long process and just creating the indexes after the end of the > transaction seems

Re: [sqlite] New Query Question

2005-07-26 Thread Jay Sprenkle
On 7/26/05, Clark Christensen <[EMAIL PROTECTED]> wrote: > > > --- David Fowler <[EMAIL PROTECTED]> wrote: > > > Hello again to everyone. > > I'm having trouble with the following query: > > SELECT tables.id FROM ( > > SELECT table4.location, table4.id > > FROM table1 > > INNER JOIN table2 ON

Re: [sqlite] Segmentation fault on large selects

2005-08-01 Thread Jay Sprenkle
On 7/31/05, scunacc <[EMAIL PROTECTED]> wrote: > Dear all, > > SQLite is wonderful. Thank you for this piece of software. > > I have a problem however with large tables > 1M rows. Are you running out of memory?

Re: [sqlite] Long retrieval times

2005-08-02 Thread Jay Sprenkle
did you try this instead of not equal? (x >= 'abc' AND x < 'abd').

Re: [sqlite] ATTACH, query and differentiate

2005-08-04 Thread Jay Sprenkle
> I now want to be able to give the option of opening a second database file, > with the same table structure - which i believe is acheived using the ATTACH > command. However the ids sent to the client still need to be unique, it is my > understanding that a SELECT command will treat both

<    1   2   3   4   5   6   7   >