[sqlite] join metadata in query results

2008-01-01 Thread Jay Sprenkle
Good afternoon all, I'm working on a project using Sqlite. I'm using a query to fill a table presented to the user. I'd like to be able to edit the data cell by cell. I can easily call the column metadata functions and get the database, table, and column where that data came from. If I want to

Re: [sqlite] join metadata in query results

2008-01-01 Thread Jay Sprenkle
> >If they try to edit a column from the Role table how do I get to Role.Id? > >If I can get Sqlite to tell me what it used to select the row in the result > >set > >it would be much easier that the alternatives. > > You can always query the ROWIDs (as long as there is no GROUP > BY), with

Re: [sqlite] join metadata in query results

2008-01-01 Thread Jay Sprenkle
On Jan 1, 2008 4:58 PM, Kees Nuyt <[EMAIL PROTECTED]> wrote: > You know the query, and also the schema, for example from > PRAGMA table_info(tabelname); > That includes primary key info. > Merge that with the info from the resultset and you know what > you need to know, don't you? Almost.

Re: [sqlite] join metadata in query results

2008-01-02 Thread Jay Sprenkle
On Jan 2, 2008 5:31 AM, Kees Nuyt <[EMAIL PROTECTED]> wrote: > >If the engine within sqlite recorded the row id as it > >fetched each column it would be trivial and would > >prevent me from having to query the database again. > >If it's not present in the current code I found a solution that

Re: [sqlite] sqlite3_get_table(); How to get all column names in C?

2008-01-02 Thread Jay Sprenkle
Did you try to query the table 'sqlite_master'? You can get the schema for any table by referencing the query results.. On Jan 2, 2008 4:52 PM, Jerry Krinock <[EMAIL PROTECTED]> wrote: > Is there any way to get a list of all column names in a table via the > C API, which works even when there are

Re: [sqlite] How to compile SQLite with SQLITE_ENABLE_COLUMN_METADATA option under Ubuntu Linux

2008-01-07 Thread Jay Sprenkle
On Jan 6, 2008 3:16 PM, Luc DAVID <[EMAIL PROTECTED]> wrote: > > Could you tell me the best way to achieve this under unbuntu and if I > can optimise the compilation under Windows (the sqlite.dll size is quite > important) ? There are many ways. Most compilers allow you to define a string with a

Re: [sqlite] Repository for User defined functions

2008-01-11 Thread Jay Sprenkle
The source for the SHA1 algorithm is available on the internet. On Jan 10, 2008 7:35 PM, Mike McGonagle <[EMAIL PROTECTED]> wrote: > Hello all, > I was just curious if there was a respository for user defined functions? I > was hoping to find a hash function that I could use to hash some strings

Re: [sqlite] Optimized way of export/import of the sqlite database through C API Interface

2008-01-11 Thread Jay Sprenkle
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite http://www.reddawn.net/~jsprenkl/Sqlite Source code is there to download. - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] How to compile SQLite with SQLITE_ENABLE_COLUMN_METADATA option under Ubuntu Linux

2008-01-14 Thread Jay Sprenkle
> I found some answer to my previous questions and wrote a short tutorial > at http://source.online.free.fr/Linux_HowToCompileSQLite.html a ".o" file is a collection of compiled code called an 'object' file. A library file is very similar but includes a directory so some of the file can be

Re: [sqlite] sqlite3 performace

2008-01-18 Thread Jay Sprenkle
On Jan 17, 2008 3:48 PM, Philip Nick <[EMAIL PROTECTED]> wrote: > Greetings, > > Currently I am using sqlite3 in a multi-process/multi-threaded server > setting. opening a file is very slow. You need to move it out of your loop. > I have noticed my program basically reads the whole database

[sqlite] sql optimization question

2008-01-18 Thread Jay Sprenkle
I'm deleting a tree of data stored in sqlite and was looking for the most efficient way to do it. I thought the best solution was to delete the row and then delete all the orphaned rows the referenced it in a loop delete from category where id = 5; To delete the orphaned rows I repeat one of the

Re: [sqlite] Slow query on one machine

2008-01-19 Thread Jay Sprenkle
On Jan 18, 2008 3:32 PM, RB Smissaert <[EMAIL PROTECTED]> wrote: > The application > that runs this is exactly the same on both machines. The slow machine is > actually slightly slower specification wise, but that can't explain the huge > differences in timings. > Have you run spinrite ( a disk

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread Jay Sprenkle
On Jan 20, 2008 10:19 AM, Fowler, Jeff <[EMAIL PROTECTED]> wrote: > > Not trying to be antagonistic, but I'm curious to know how many of you agree > with Darren's sentiments on this issue. Sqlite is DRH's project. Voting doesn't come into the picture anywhere. If you convince him to fix it then

Re: [sqlite] sql optimization question

2008-01-21 Thread Jay Sprenkle
> In response to the deletion of (0,null), the trigger fired, deleting > (1,0), and (2,0). But the trigger didn't fire again in response to > either of these subsequent deletions, so (3,1) was not automatically > deleted. > > If anyone knows how to get around this problem, I would like to know.

Re: [sqlite] sql optimization question

2008-01-21 Thread Jay Sprenkle
On Jan 20, 2008 9:16 PM, Ken <[EMAIL PROTECTED]> wrote: > Jay > > I've used a trigger to do this with good success. > > You'll need one trigger per table to cause the delete to cascade through > the tree. > > Or if you know that you will always delete from the top level tree"parent" > then

Re: [sqlite] Query problem

2008-01-23 Thread Jay Sprenkle
You need single quotes for text literals. On Jan 23, 2008 6:15 AM, Yasir Nisar <[EMAIL PROTECTED]> wrote: > SELECT * FROM BackupTable,BackupItemTable,BackItUpPathTable WHERE > lower(BackItUpPathTable.WinName) GLOB lower("*1[]1.txt*") AND > BackupItemTable.BKItemSize > -1 AND

Re: [sqlite] Multiple Threads with a DROP command

2006-06-15 Thread Jay Sprenkle
On 6/15/06, James Butts <[EMAIL PROTECTED]> wrote: In the main thread, I open a connection to database and create a timer function and start a worker thread. The worker thread establishes its own separate connection to database. The worker thread creates a table and then signals the main

Re: [sqlite] Duplicate records

2006-06-15 Thread Jay Sprenkle
Hi All, I'm creating a database which will look a little like: create table main (f1 TEXT, f2 TEXT, f3 TEXT, t1 TEXT, t2 TEXT, tn TEXT); f1, f2 and f3 will always be present. Any or all of the ts might be NULL. I'd like to prevent entries where all of the fields are the same being created. How

Re: [sqlite] SQLite Vs VistaDB - Comparison ???

2006-06-16 Thread Jay Sprenkle
On 6/16/06, René Tegel <[EMAIL PROTECTED]> wrote: i found MS-Access a very reasonable flat-file database. It may lack fancy features like encrytion, but has it advantages as well Pro's: any windows client has the driver installed (no need to install office), accessable by odbc, reasonable sql

Re: [sqlite] accessing sqlite files directly via http

2006-06-16 Thread Jay Sprenkle
On 6/15/06, John Stanton <[EMAIL PROTECTED]> wrote: I have implemented just such a system as an RPC. It accesses an HTTP server using CGI and returns the table or view requested in XML. How do you ensure non malicious code is sent to RPC? -- SqliteImporter and SqliteReplicator: Command line

Re: [sqlite] SQLite Vs VistaDB - Comparison ???

2006-06-16 Thread Jay Sprenkle
On 6/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Mikey C <[EMAIL PROTECTED]> wrote: > > Please implement table and row level locking. :-) If you think you know a way to implement row-level locking that does not impose one of the above limitations, then please tell me and I will look

Re: [sqlite] Opening the database file for read on Windows XP

2006-06-21 Thread Jay Sprenkle
On 6/21/06, Ran <[EMAIL PROTECTED]> wrote: I have an application that uses sqlite3 API, and open the database file. While the file is opened (for reading) by sqlite3, I would like to copy the database file (so to have a copy of the file). I guess I need to place a shared lock on the file (like

Re: [sqlite] Opening the database file for read on Windows XP

2006-06-21 Thread Jay Sprenkle
On 6/21/06, Ran <[EMAIL PROTECTED]> wrote: Thanks for your reply. I know that I should lock the file before copying it, and the "BEGIN IMMEDIATE" is indeed a nice trick. However, I think I didn't explain my problem clearly. I would like to copy that file _without_ using the sqlite library (so

Re: [sqlite] Delete performance vs. Insert performance

2006-06-21 Thread Jay Sprenkle
On 6/21/06, Christian Smith <[EMAIL PROTECTED]> Adding to the free list will touch each page at most once, and thus caching adds no benefit (and has no loss for a smaller cache.) Inserting may touch each page multiple times, for such operations as rebalancing the tree. Therefore, a larger cache

Re: [sqlite] Count and Display

2006-06-22 Thread Jay Sprenkle
On 6/22/06, andrew gatt <[EMAIL PROTECTED]> wrote: Thanks for your reply, yes i can use the limit clause but it would help me greatly if i could also get the offset out of the query. So i can then calculate the next offset and limit. For example: Doing a list box of results? I've found users

Re: [sqlite] Sqlite crashes when i imort huge list

2006-06-26 Thread Jay Sprenkle
On 6/26/06, C.Peachment <[EMAIL PROTECTED]> wrote: >>The use of sequential numbers as the trailing part of the 'word' >>results in a continual rebalancing of the b-tree with each insertion. >Is that right considering it looks like you have not created an index on >the word column before

Re: [sqlite] sqlite and in memory databases

2006-06-27 Thread Jay Sprenkle
Yes, several others on this forum have done exactly that. I believe the forum is archived somewhere, but I don't know where. It might provide some leads. On 6/26/06, james osburn <[EMAIL PROTECTED]> wrote: i am looking for a embeddable sql database that i can use to manipulate memory stored in

[sqlite] parsing explain output

2006-06-27 Thread Jay Sprenkle
It occurs to me a program to read explain output and provide suggesions in english would be a useful thing. Has anyone already done anything along this line? Thanks! -- SqliteImporter and SqliteReplicator: Command line utilities for Sqlite http://www.reddawn.net/~jsprenkl/Sqlite Cthulhu Bucks!

Re: [sqlite] subtracting days from two dates

2006-06-27 Thread Jay Sprenkle
On 6/27/06, mithin <[EMAIL PROTECTED]> wrote: Hi, I want to find if the difference between the days of two dates is less than or greater than some number. The year is not in the picture and it can be anything. I gave the following query but it is not working. SELECT * FROM date_details WHERE

Re: [sqlite] use of index in ORDER BY clause

2006-06-27 Thread Jay Sprenkle
On 6/27/06, Jens Miltner <[EMAIL PROTECTED]> wrote: When I run a query like SELECT foo.id AS foo_id, bar.id AS bar_id FROM bar LEFT JOIN foo ON foo.id=bar.foo_id ORDER BY bar.something I think it's using the join first to determine what goes in the

Re: [sqlite] Preferred way to copy/flush new memory db to disk db ?

2006-06-28 Thread Jay Sprenkle
On 6/28/06, RohitPatel <[EMAIL PROTECTED]> wrote: My requirements are > database file must be removed from disk if any error while > creating/copying tables, records or > indices > other application or other instance of same app must not be able to access > the database, till > database is

Re: [sqlite] hard copy docs

2006-06-28 Thread Jay Sprenkle
On 6/28/06, Dennis Jenkins <[EMAIL PROTECTED]> wrote: > The developers at my company have dual-headed displays. Very nice. I highly recommend that others try it if they can. It makes debugging much easier when you can have your app open on one monitor and the debugger on the other. Or when

Re: [sqlite] use of index in ORDER BY clause

2006-06-29 Thread Jay Sprenkle
On 6/29/06, Jens Miltner <[EMAIL PROTECTED]> wrote: Is there any way to improve the ORDER BY performance for joined queries? From your answer that the intermediate results are sorted, I take it no index won't ever be used when using ORDER BY with a join query? You can use the explain command

Re: [sqlite] sqlite3_free_table question

2006-06-29 Thread Jay Sprenkle
On 6/29/06, Richard Boyd <[EMAIL PROTECTED]> wrote: I now check for NULL to be sure that I'm trying to free up a pointer that actually points to something. Is there an easy way for me to ensure that the memory has been successfully freed up? I understand this might be a basic C question rather

Re: [sqlite] database corruption

2006-06-30 Thread Jay Sprenkle
On 6/29/06, Jens Miltner <[EMAIL PROTECTED]> wrote: Hi everybody, We have encountered two corrupted databases so far at customers and we have no idea how they could become corrupted (we haven't had any corruption in house so far). Check your hardware too. A lot of cheap commodity hardware is

Re: [sqlite] Querying a value with an ampersand

2006-07-05 Thread Jay Sprenkle
On 7/5/06, Roger <[EMAIL PROTECTED]> wrote: I have a company name as follows: Chemistry & chemicals I have plenty of those in my database which come with ampersands, now when i do a query i get nothing. How best can i write the query using a string with an ampersand as part of it. select *

Re: [sqlite] Compressing the DBs?

2006-07-06 Thread Jay Sprenkle
On 7/5/06, Mikey C <[EMAIL PROTECTED]> wrote: What platform are you using? If you are using NTFS filesystem you can just mark the file for compression and the OS takes care of it transparently. The linux OS supports Reiser file systems. This will compress on the fly with the compression

Re: [sqlite] Compressing the DBs?

2006-07-06 Thread Jay Sprenkle
On 7/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm guessing that the random I/O behavior of SQLite will frustrate the compression implemented by NTFS and Reiser. The end result will be a database file that might actually take up more space than if it were uncompressed. I'd be

Re: [sqlite] JOIN Error!!!

2006-07-07 Thread Jay Sprenkle
On 7/7/06, Roger <[EMAIL PROTECTED]> wrote: I have the following query CREATE VIEW MyStuff AS SELECT Com . CompanyID CompID , PublicationID PubID , Your SQL looks very confused. Are there really spaces around the period here or is that just in this message? Spaces are important for the

Re: [sqlite] Re: Re: JOIN Error!!!

2006-07-07 Thread Jay Sprenkle
What does not seem to be in the right order? The syntax is SELECT Expression AS Alias ...; In the first query it appears compid is the alias, in the second it appears it's the column id. > You don't need to create an alias explicitly to create a view. You don't need to have aliases, but

Re: [sqlite] Re: Re: JOIN Error!!!

2006-07-07 Thread Jay Sprenkle
On 7/7/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > What does not seem to be in the right order? The syntax is > > SELECT Expression AS Alias ...; In the first query it appears compid is the alias, in the second it appears it's the column id. I see my mistake, he actually did

Re: [sqlite] JOIN Error!!!

2006-07-07 Thread Jay Sprenkle
On 7/7/06, Roger <[EMAIL PROTECTED]> wrote: Can anyone help me out here, i am a bit stuck and this is a very strange error indeed! Having a copy of your database might help if you can post it.

[sqlite] optimizing your sql

2006-07-10 Thread Jay Sprenkle
Good morning all, A poster to digg mentioned some sql performance tuning tips. I've checked one of them out to see what difference it makes. My results are below, but first here's the poster's tuning tip list: // SQL tuning tips // // Avoid using the following: // // - Boolean operators >, =,

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: * Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-10 17:30]: > // - Use SQL Joins instead of using sub-queries Not so fast there. I have accelerated queries by several 100 percent by turning joins into subqueries. On other occ

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
> >Not so fast there. I have accelerated queries by several 100 > >percent by turning joins into subqueries. On other occasions I > >did so by turning subqueries into joins. The performance of > >joins vs subqueries in any non-trivial query depends on a > >*lot* of variables. You can't just say

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: OTOH sometimes a correlated subquery that just collects data is faster to execute or more readily optimisable when expressed as a JOIN. I remember such a case, but it wasn't in my code so I paid insufficient attention and now my memory of the

Re: [sqlite] SQL error: database disk image is malformed

2006-07-11 Thread Jay Sprenkle
I am developping a freeware which uses SQLite. One of my beta testers informed me about an issue he had: with his DB, following the query which is sent to the DB, I have the error in the subject of this email. I did some testing, and when I succeeded in reproducing the error just by doing a

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: Hello, I'm currently using SQLite3 on my multi-threaded software. I have tried several ways for dealing with my issue, however, I came to the conclusion that there must be some trick I havent been told of. It wasn't clear to me when I

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: About the "cant read while writing", how to avoid this?, I cant stop my system while using the database. There would be no point on having a database then. check the return code from operation, if it says Busy, or Locked, the redo the

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
of 64 bits, or 32bits pc with clustering? On 7/12/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > > > Hello to everybody! > > > > I want to ask to the people something... If i have a table with about > > 8.000.000.000 registers, and i have to do a select in a numeri

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: I don't care about hardware... i will do cluster... but which DB motor do think will be good for work with great velocity in select (sqlite, postgresql or mysql). ah.. i almost forgot... i will do a great number of select... I

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: Yeah and while we're at it, he could invest a few bucks on a couple twin diesel generators, a battery room, and whatnot, a group of hookers to save the night. You forgot the beer and pizza delivery contract!

Re: [sqlite] using max value

2006-07-13 Thread Jay Sprenkle
On 7/13/06, Christian Smith <[EMAIL PROTECTED]> wrote: You can't use aggregate functions in WHERE clauses. Also, you can't use a select as the value in an insert. You can insert from the results of an insert. uh...It seems to work: SQLite version 3.0.8 Enter ".help" for instructions sqlite>

Re: [sqlite] Major projects using SQLite

2006-07-14 Thread Jay Sprenkle
On 7/14/06, Jon García de Salazar Bilbao <[EMAIL PROTECTED]> wrote: Hi, Could you give examples of some major software projects using SQLite? I created an events management website for a local convention. sqlite was used for the storage and management of all the events at the convention.

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread Jay Sprenkle
On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, everybody I'm using a SQL clause to get data from the DB, and I need to use "computed" fields to get the value of other fields. A (stupid) example of what I need is this: SELECT IDContractLevel, IDContractLevel > 4 as IAmBoss,

Re: [sqlite] This great!

2006-07-17 Thread Jay Sprenkle
On 7/17/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: Hello to everybody...!!! I was using my old notebook the weekend, and i was doing some programs in C to try SQLite performance, and I am happy, because i could insert 4.000.000rows in 10 minutes in my old notebook( Pentium II

Re: [sqlite] This great!

2006-07-17 Thread Jay Sprenkle
On 7/17/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: I am wondering if it will have a better performance if i split every index and table into different files, i know that i will loose the LITE concept, but i am wondering if it will have a better performance... I doubt it,

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread Jay Sprenkle
On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, and thanks for the reply. SELECT * from Employees where IDContractLevel > 4 is not enough, since I actually need to use a field that is created inside the SQL statement to create another field. The problem is that it seems that

Re: [sqlite] count(*)

2006-07-17 Thread Jay Sprenkle
On 7/17/06, Sripathi Raj <[EMAIL PROTECTED]> wrote: Hi, I read in one of the threads that count(*) has to be hand optimized since SQLite doesn't optimize it. Any pointers on how to do that? When doing joins put the table that contributes the smallest number of rows to the result set as the

Re: [sqlite] count(*)

2006-07-19 Thread Jay Sprenkle
On Wed, 19 2006 06:08:49 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Brannon King <[EMAIL PROTECTED]> wrote: > It's too bad you can't do an offset > of negative one so that it would start at the back. That should be darn > fast. Something like: > > select rowid from table limit 1 offset

Re: [sqlite] Compress function

2006-07-19 Thread Jay Sprenkle
The author of Sqlite also sells a version that compresses and encrypts the database. On 7/19/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: Thanks Hugh, i think it will be useful for me... On Wed, 19 Jul 2006 16:07 +0100 (BST), Hugh Gibson <[EMAIL PROTECTED]> wrote: > > You could

Re: [sqlite] Compress function

2006-07-19 Thread Jay Sprenkle
On 7/19/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: Do you know for how much money? On 7/19/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > > The author of Sqlite also sells a version that compresses and encrypts > the database. from this page: http://ww

Re: [sqlite] Importing Oracle 8.1.7 data into SQLite

2006-07-20 Thread Jay Sprenkle
On 7/20/06, Vinod Inamdar <[EMAIL PROTECTED]> wrote: Dear All, I am a newbie to SQlite and I require the above mentioned functionality in the subject line for a specific project. Is it possible to import Oracle 8.1.7 data into SQLite. Also is it possible to export data from SQLite to Oracle

Re: [sqlite] How to calculate the sum up to a row better than O(n^2)?

2006-07-20 Thread Jay Sprenkle
On 7/20/06, Michael Sizaki <[EMAIL PROTECTED]> wrote: Hi, Suppose I have a database: CREATE TABLE data (timestamp INTEGER, amount INTEGER); INSERT INTO data VALUES(1,10); INSERT INTO data VALUES(2,20); INSERT INTO data VALUES(3,5); INSERT INTO data VALUES(4,2); ... Now I

Re: [sqlite] Help me in SQL

2006-07-21 Thread Jay Sprenkle
Can you change the alias to a different field name than the source tables? On 7/20/06, blins <[EMAIL PROTECTED]> wrote: Hi sqlite-users@sqlite.org, I use sqliteODBC 0.68 + ADO and SQLite 3.3.6. I try executing sql: select t1.field1 as field1, t2.field2 as field2 from table1 t1 left join

Re: [sqlite] SQLite NFS Problem compared to Other Db's

2006-07-21 Thread Jay Sprenkle
On 7/21/06, Ritesh Kapoor <[EMAIL PROTECTED]> wrote: I've also removed the Synch-mechanism and increased the SQLite page size as well as the number of pages to hold in cache. I understand that all this can cause data loss if the system crashes but that is tolerable. What I can't figure out is

Re: [sqlite] Using prepare, step, finalize and hadling BUSY answers

2006-07-21 Thread Jay Sprenkle
On 7/21/06, Daniel van Ham Colchete <[EMAIL PROTECTED]> wrote: I'm having problems understanding the SQLite docs. At the 'C/C++ Interface for SQLite Version 3' it says that sqlite3_exec is a wrapper to 'prepare, finalize, reset' without a step. But a little bit down the document it says you

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Jay Sprenkle
Jay, thank you very much man! That answers a lot. And it showed me that I was not checking the SQLITE_LOCKED case. But, from what I can see, if your database is busy or locked you just stop your program execution, or you will end this function WITHOUT running neither sqlite3_finalize nor

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Jay Sprenkle
> That's what I think as well. But, when you say 'all your suggestions' are you talking about sqlite3_interrupt too? That would be useful if you were doing queries where you don't know how long they will take. All my code is written in a way the queries are short so I would not have to abort

Re: [sqlite] Handling files in sqlite db

2006-07-24 Thread Jay Sprenkle
On 7/24/06, sandhya <[EMAIL PROTECTED]> wrote: Hi, Can anybody help me. Is there any possibility to import files from the local file system and storing in sqlite DB.And Is there any export option just to check whether The file system is designed to manipulate files. A database is

Re: [sqlite] selecting rows of the view via its position

2006-07-24 Thread Jay Sprenkle
How can I select the predecessor or successor of a current row for comparing values? - without explicit ids on the view! (I think ids don't work for views?) Or if ids are possible, how are they implemented and can I create ID-Counters groupwise for blocks of a table?? What does your schema look

Re: [sqlite] locked implies exception?

2006-07-24 Thread Jay Sprenkle
On 7/24/06, Xavier Noria <[EMAIL PROTECTED]> wrote: I am trying to understand a crash I get very often. There are two processes accessing to the same database in a Windows XP (through Active Record) doing simple CRUDs on tables, and from any of the two at random I get an SQLite3::BusyException,

Re: Re[2]: [sqlite] Help me in SQL

2006-07-24 Thread Jay Sprenkle
On 7/23/06, blins <[EMAIL PROTECTED]> wrote: Hi Jay, Friday, July 21, 2006, 7:05:59 PM, you wrote: JS> Can you change the alias to a different field name than the source tables? I try: select t1.field1 as otherfield1, t2.field2 as otherfield2 from table1 t1 left join table2 t2 on

Re: [sqlite] Temp dir

2006-07-24 Thread Jay Sprenkle
On 7/21/06, chtaylo3 <[EMAIL PROTECTED]> wrote: >Set the global variable sqlite3_temp_directory to any >directory you want and it tries that directory first. Ok, fair enough. But why do you try and open the directory? Why can you just try and create the tmp file there and deal with it if

Re: [sqlite] Is BETWEEN faster than comparison operators?

2006-07-24 Thread Jay Sprenkle
On 7/23/06, Hartwig Wiesmann <[EMAIL PROTECTED]> wrote: Hello, I have read somewhere that BETWEEN is faster than the equivalent expression using comparison operators. Example: ... WHERE Column BETWEEN 1 AND 10 compared with ...WHERE Column >= 1 AND Column <= 10 between is definitely

Re: [sqlite] Temp dir

2006-07-24 Thread Jay Sprenkle
On 7/24/06, chtaylo3 <[EMAIL PROTECTED]> wrote: >/tmp : Temporary files >/var/tmp : Temporary files preserved between system reboots What does this have to do with having the tmp dir's as global read? It's important that the journal file be preserved between reboots. If the power fails you

Re: [sqlite] locked implies exception?

2006-07-24 Thread Jay Sprenkle
> what's a CRUD? I wondered that too. http://en.wikipedia.org/wiki/CRUD_(acronym) Martin Thanks :)

Re: [sqlite] Temp dir

2006-07-24 Thread Jay Sprenkle
On 7/24/06, chtaylo3 <[EMAIL PROTECTED]> wrote: Jay, >It's important that the journal file be preserved between reboots. >If the power fails you can then recover the database using the journal. >If your code has to go on one of the linuxes(linuxii??) >that follow posix/LSG standards you'll want

Re: [sqlite] selecting rows of the view via its position

2006-07-24 Thread Jay Sprenkle
Thank you very much for your help! Unluckily I can't get rowids on views. sqlite does not declare an error, when I select rowid, * on a view. - It just prints this column empty! The problem is, that I have to sort first and then the numbering. So I can't use the table rowids of the base table.

Re: [sqlite] Getting callback with an INSERT

2006-07-24 Thread Jay Sprenkle
On 7/24/06, Dennis Cote <[EMAIL PROTECTED]> wrote: You can do this by adding an insert trigger to your table and registering a user function that will call back to your code. create trigger t_in after insert on t begin select do_insert_callback(new.rowid); end; You will have to

Re: [sqlite] selecting rows of the view via its position

2006-07-24 Thread Jay Sprenkle
On 7/24/06, hanno <[EMAIL PROTECTED]> wrote: Hello Jay! Assigning the ids outside sql wouldn't be neccessary because I could easily see the predecessor and successors. You are completely right, when you suggest a sql-external solution. For better understanding I should explain my situation a

Re: [sqlite] test program won't run anymore! sqliteBtreeOpen: Assertion 'seizeof...

2006-07-24 Thread Jay Sprenkle
On 7/24/06, Keiichi McGuire <[EMAIL PROTECTED]> wrote: test: ../sqlite-2.8.17/src/btree.c:702: sqliteBtreeOpen: Assertion 'sizeof(ptr)==sizeof(char*)' failed. Aborted Did you change compilers? Or compile the DLL on a different version than you compiled the test program?

Re: [sqlite] test program won't run anymore! sqliteBtreeOpen: Assertion 'seizeof...

2006-07-24 Thread Jay Sprenkle
On 7/24/06, Keiichi McGuire <[EMAIL PROTECTED]> wrote: Previously when I went into sqlite via command line I could not create a table, and I would get that same error message. So what I did was that I reinstalled sqlite, to a different directory so I can keep my other version to see if I can

Re: [sqlite] locked implies exception?

2006-07-25 Thread Jay Sprenkle
On 7/25/06, John Stanton <[EMAIL PROTECTED]> wrote: Martin Jenkins wrote: > John Stanton wrote: > >> I used to have one but I had to shoot it when it went feral. > > As a puppy? > No, not until instead of just chasing cars it started catching and eating them. Wouldn't that be 'cacheing' them

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Rob Richardson <[EMAIL PROTECTED]> wrote: few milliseconds after the first one. I am getting an access violation inside sqlite3.dll when the second thread calls sqlite3_prepare(). Am I trying to do something I shouldn't? Bugs aside, that should work. It doesn't sound like a very

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-26 Thread Jay Sprenkle
FYI ACOVEA (Analysis of Compiler Options via Evolutionary Algorithm) implements a genetic algorithm to find the "best" options for compiling programs with the GNU Compiler Collection (GCC) C and C++ compilers. "Best", in this context, is defined as those options that produce the fastest

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Rob Richardson <[EMAIL PROTECTED]> wrote: Jay, After the first thread, a graph will be displayed and the user can start doing things on it while the next batch of data is being loaded. Ah. "Many readers" should work fine. An access violation sounds like a bad pointer or a compile

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Rob Richardson" <[EMAIL PROTECTED]> wrote: > I found the spot where I was telling the two threads to use the same > database pointer instead of running on separate ones. Once I fixed > that, it works. > It has been suggested that I add

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
> Will the mutex replace file locking for database access control? > No. A mutex only works within a single process. I was thinking it might make a good compile time option. If you aren't going to access the database from multiple machines then the mutex could replace file locking as an

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: Jay Sprenkle wrote: >> > Will the mutex replace file locking for database access control? >> > >> >> No. A mutex only works within a single process. > > > I was thinking it might make a good compile

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: > > Almost a "plug-in" serialization organization. I don't think I've ever > seen anyone do it that way, but that might be really valuable. > The embedded software guys would just love it. We had an ISAM product which worked after that

Re: [sqlite] retrieving integers and long

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Wyan <[EMAIL PROTECTED]> wrote: I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long long. Is there any way to distinguish which one it is, so I can know to call the right

Re: [sqlite] re: [sqlite] Retriving data from SQLite

2006-07-27 Thread Jay Sprenkle
On 7/27/06, mycmos <[EMAIL PROTECTED]> wrote: --- Vivek R <[EMAIL PROTECTED]>写道: > Hi , > I am new bee to SQLite, I am using SQLite in one of > the embedded > applications. What I wanted to know how to retrive > the data from table once > the query is exected? how to store the results of >

Re: [sqlite] User function in WHERE clause

2006-07-27 Thread Jay Sprenkle
On 7/27/06, Stan <[EMAIL PROTECTED]> wrote: Hi, is there a way to create user function similar to LIKE? I'd like to use my function in clause WHERE. E.g. this selection: SELECT * FROM Table WHERE Name MYFUNCTION param Param is integer. http://sqlite.org/capi3ref.html#sqlite3_create_function

Re: [sqlite] IO Access Time

2006-08-01 Thread Jay Sprenkle
On 8/1/06, Aseem Rastogi <[EMAIL PROTECTED]> wrote: 1. How does SQLite behave as compared to our current approach regarding I/O access time ? 2. How much disk space does SQLite take as compared to flat text file ? If somebody has some benchmarking data for these issues, it will be really

Re: [sqlite] SQLite and ASP Classic

2006-08-01 Thread Jay Sprenkle
On 8/1/06, Artie Pagan <[EMAIL PROTECTED]> wrote: Does anyone know what the connection string is for SQLite using ASP classic? Does that have fewer calories than "New ASP" or does it just taste better? ;)

Re: [sqlite] txt

2006-08-03 Thread Jay Sprenkle
On 8/3/06, Markus Mössner <[EMAIL PROTECTED]> wrote: Hi! Well I am almost new to everything that deals with db s. My question is it possible to something like this mysql_query ("LOAD DATA LOCAL INFILE 'c:/php-w-select/Data/$dataset' INTO TABLE $fil fields terminated by ' * ' "); Look at

Re: [sqlite] what tier architecture?

2006-08-07 Thread Jay Sprenkle
On 8/7/06, John Newby <[EMAIL PROTECTED]> wrote: Hi, this is probably a stupid question and it has nothing to do with SQlite per se so I apologise in advance for hijacking the emails withmy question plus I don't even know if this is the right place to ask the question. I have created a GUI to

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread Jay Sprenkle
On 8/8/06, wqual <[EMAIL PROTECTED]> wrote: Hi Donald, thanks for this valuable comment. Regarding the regexp-function, I am not really sure whether I understood it entirely or not: is it correct that I can use the regexp *only* in external programs (e.g. a perl programme), but not on the sqlite

Re: [sqlite] Replace of substring in sqlite-table - how can I do this?

2006-08-08 Thread Jay Sprenkle
On 8/8/06, Olaf Beckman Lapré <[EMAIL PROTECTED]> wrote: How would this compare to the performance of simply (progammatically) doing an UPDATE and changing the values in a callback hook. If this is impossbile than even a SELECT with a callback where one does an UPDATE for each returned row

  1   2   3   4   5   6   7   >