Re: [sqlite] Memory databases

2006-05-24 Thread Joe Wilson
--- Unit 5 <[EMAIL PROTECTED]> wrote: > I have a couple of questions on :memory: databases: > > 1) What happens when a table grows in size more than > the available RAM? Does sqlite revert to file based > mechanism to handle it or would it throw an error? If your OS is Windows or UNIX, your

Re: [sqlite] GROUP BY regression workaround?

2006-05-24 Thread Joe Wilson
> In the meantime, you can work around the problem by > implementing the GROUP BY function in your application > code. Remove the aggregate functions and GROUP BY > clause from your query and just return every row of > the intermediate table, then compute the aggregates > and grouping yourself.

Re: [sqlite] Re: updating with unique match

2006-05-24 Thread David Bicking
On Wed, 2006-05-24 at 11:20 -0400, Igor Tandetnik wrote: > David Bicking wrote: > > This is more an SQL than SQLITE question. > > > Something like this: > > update requests r set psref = > (select psref from actuals a where r.cust=a.cust and > r.amount=a.amount) > where r.psref is null and

Re: [sqlite] GROUP BY regression workaround?

2006-05-24 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > > The old GROUP BY algorithm was extremely efficient whether or > not the GROUP BY terms were indexable or not. > There were cases where the old algorithm performed very, very poorly. You have found a case where the new algorithm performs poorly,

Re: [sqlite] GROUP BY regression workaround?

2006-05-24 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > > Joe Wilson <[EMAIL PROTECTED]> wrote: > > > Anyone have any ideas how to speed up GROUP BY on huge views > > > in recent versions of SQLite? > > > > > > http://www.sqlite.org/cvstrac/tktview?tn=1809 > > > > > > The older versions of SQLite (prior to SQLite 3.2.6)

RE: [sqlite] In the year 4461763

2006-05-24 Thread Chris Werner
On Wednesday, May 24 2006, Christian Smith wrote: > Datetime in SQLite is represented as a 64 bit floating point > value. The units are seconds since the unix epoch. > > What you're seeing is the limited precision (48 bits I believe) > of 64 bit floating point numbers. Not a problem for real

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
John Stanton wrote: Jay Sprenkle wrote: On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: > IIRC, That has been suggested in the past, the consensus was to not > include extra functions, in keeping with the 'lite' in the project > name. A very sound decision. Bloat is the enemy of all

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
Jay Sprenkle wrote: On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: > IIRC, That has been suggested in the past, the consensus was to not > include extra functions, in keeping with the 'lite' in the project > name. A very sound decision. Bloat is the enemy of all good software. A

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Jay Sprenkle
On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: > IIRC, That has been suggested in the past, the consensus was to not > include extra functions, in keeping with the 'lite' in the project > name. A very sound decision. Bloat is the enemy of all good software. A conditional compile point

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
Jay Sprenkle wrote: On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: Repeatedly installing a set of functions is not a good approach unless the application is persistent. A particularly bad case is a very common one, opening and closing an Sqlite DB in response to WWW requests. Much

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
Jay Sprenkle wrote: On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: A simple way to do that would be to have a conditional compile built into the function tables in func.c so that user written modules could be conditionally compiled in. A quick glance at the code suggests that two

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
Roberto wrote: On 24/05/06, Christian Smith <[EMAIL PROTECTED]> wrote: Attach a patch to the ticket that implements your new functions. Send your declaration of dedication of the code to the public domain to the list, and hope DRH includes the patch in the next release. IIRC, That has been

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Jay Sprenkle
On 5/24/06, John Stanton <[EMAIL PROTECTED]> wrote: Repeatedly installing a set of functions is not a good approach unless the application is persistent. A particularly bad case is a very common one, opening and closing an Sqlite DB in response to WWW requests. Much better that the functions

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
Mikey, I think that you are on the right track and placing your code in the right place. I probably have the core of many of the functions you want, all coded in ANSI C which fits straight into Sqlite. The conditional compile approach would work very well and efficiently, applying no

Re: [sqlite] one table per file?

2006-05-24 Thread John Stanton
You can have one table per file with Sqlite by have multiple databases, each one with one table and then ATTACHing them. You might, however, be better off with one file and multiple tables. Petr Krenzelok wrote: Hi, sorry if my question is kind of stupid, but I would like to ask following.

[sqlite] Compiling a Library or Mac OS X using Xcode

2006-05-24 Thread Jerry Krinock
Apple is currently shipping SQLite 3.1.3 in Mac OS 10.4, but SQLite 3.3.5 is much better. Anybody with a Mac and Developer Tools installed can build a the latest version of SQLite as a library in 5 minutes. The hard part was getting my project to use it instead of /usr/lib/libsqlite3.dylib

Re: [sqlite] NOT NULL in create table command not work

2006-05-24 Thread Will Leshner
On 5/23/06, Nguyen Dang Quang <[EMAIL PROTECTED]> wrote: But my application still insert emty string into DIRECTORY field An empty string? Or NULL? There is a difference.

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread John Stanton
We added some date functions into Sqlite, and it was a trivial exercise because the function interface is tidy and easy to figure out. What would be elegant is to have an ability to compile user written functions into new versions of Sqlite without having to modify the source of the new

Re: [sqlite] List of functions

2006-05-24 Thread Ran
http://www.sqlite.org/lang_expr.html On 5/24/06, Unit 5 <[EMAIL PROTECTED]> wrote: I see references to typecasting functions here in the mailing list. I have not found where they are discussed on the website. I saw some of them in the "expressions" page but seems to cover a subset of them.

[sqlite] Memory databases

2006-05-24 Thread Unit 5
I have a couple of questions on :memory: databases: 1) What happens when a table grows in size more than the available RAM? Does sqlite revert to file based mechanism to handle it or would it throw an error? 2) From some of the other posters who have done more testing than I, it seems that

[sqlite] List of functions

2006-05-24 Thread Unit 5
I see references to typecasting functions here in the mailing list. I have not found where they are discussed on the website. I saw some of them in the "expressions" page but seems to cover a subset of them. Is there a page that provides a list of all supported functions? These could be

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Mikey C
Roberto-10 wrote: > > On 24/05/06, Christian Smith <[EMAIL PROTECTED]> wrote: >> Attach a patch to the ticket that implements your new functions. Send >> your >> declaration of dedication of the code to the public domain to the list, >> and hope DRH includes the patch in the next release. > >

Re: [sqlite] In the year 4461763

2006-05-24 Thread Christian Smith
On Tue, 23 May 2006, Chris Werner wrote: Hello, I am just curious about SQLite's date and time manipulation functions. I am using the sqlite3 command line interface on the above described platform. When I select a datetime for 2^47: sqlite> SELECT datetime(140737488355328, 'unixepoch');

[sqlite] Re: updating with unique match

2006-05-24 Thread Igor Tandetnik
David Bicking wrote: This is more an SQL than SQLITE question. I have two tables: (The relevant fields are) CREATE TABLE REQUESTS ( REQ_ID INTEGER PRIMARY KEY, CUST TEXT, AMOUNT FLOAT, PSREF TEXT) CREATE TABLE ACTUALS ( PSREF TEXT, CUST TEXT, AMOUNT FLOAT ) SELECT * FROM REQUESTS; 1 | 100

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Roberto
On 24/05/06, Christian Smith <[EMAIL PROTECTED]> wrote: Attach a patch to the ticket that implements your new functions. Send your declaration of dedication of the code to the public domain to the list, and hope DRH includes the patch in the next release. IIRC, That has been suggested in the

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Christian Smith
On Wed, 24 May 2006, Mikey C wrote: I would rather add these functions directly to the core SQLite DLL in C in and compile them directly into the code (using a conditional). They then register this function by adding it to the array of existing functions: ... This seems to work (I've tried

[sqlite] Re: one table per file?

2006-05-24 Thread Igor Tandetnik
Petr Krenzelok <[EMAIL PROTECTED]> wrote: Anyway - is there any possibility to have one table per file aproach? http://www.sqlite.org/lang_attach.html Igor Tandetnik

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Jay Sprenkle
On 5/24/06, Robert Simpson <[EMAIL PROTECTED]> wrote: - Original Message - From: "Jay Sprenkle" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 24, 2006 7:17 AM Subject: Re: [sqlite] Extra functions - New Project? >Flip that around and it's easier. >Write a dll

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Robert Simpson
- Original Message - From: "Robert Simpson" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 24, 2006 7:32 AM Subject: Re: [sqlite] Extra functions - New Project? Here's the easiest way I can think of: Add one more exported function in sqlite3 called

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Robert Simpson
- Original Message - From: "Mikey C" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 24, 2006 7:25 AM Subject: Re: [sqlite] Extra functions - New Project? [snip] This seems to work (I've tried it). HOWEVER, it means altering func.c and I was looking for how to

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Robert Simpson
- Original Message - From: "Jay Sprenkle" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 24, 2006 7:17 AM Subject: Re: [sqlite] Extra functions - New Project? Flip that around and it's easier. Write a dll that loads finisar then registers the new functions. You

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Mikey C
I would rather add these functions directly to the core SQLite DLL in C in and compile them directly into the code (using a conditional). For example on the web I found an example of adding a sign() function: /* ** Implementation of the sign() function */ static void signFunc(sqlite3_context

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Jay Sprenkle
On 5/24/06, Robert Simpson <[EMAIL PROTECTED]> wrote: Actually your only option using Finisar (aside from recompiling sqlite) is to write all the functions in C/C++ in a separate DLL, and then modify Finisar to call some main exported function in that DLL, passing in a sqlite3 * object every

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Robert Simpson
- Original Message - From: "Jay Sprenkle" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 24, 2006 6:31 AM Subject: Re: [sqlite] Extra functions - New Project? I can think of two options: 1. Create a .NET assembly that wraps Finisar-Sqlite and implements the

[sqlite] one table per file?

2006-05-24 Thread Petr Krenzelok
Hi, sorry if my question is kind of stupid, but I would like to ask following. I am new here, and have not found any such topic in ML history, so: I am coming from REBOL language land. We now have wrapper for SQLite. It is very cool, tiny database, kind of free form (no columns

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Jay Sprenkle
On 5/24/06, Mikey C <[EMAIL PROTECTED]> wrote: Thanks for the response. I did think of this, but this is a pain since: 1. I am using the Finisar ADO.NET provider and to do this these functions would need to be registered every time the database connection is opened and closed and I don't want

Re: [sqlite] Patch to let SQLite run on OS/2 again

2006-05-24 Thread Peter Weilbacher (Mozilla)
On Wed, 24 May 2006 08:15:12 -0400, [EMAIL PROTECTED] wrote: >Yes. In order to directly import your patch, I need to have on >file a signed copyright release from anybody who has contributed >to the patch. The form must also be signed by your employer. >See http://www.sqlite.org/copyright.html

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Mikey C
Thanks for the response. I did think of this, but this is a pain since: 1. I am using the Finisar ADO.NET provider and to do this these functions would need to be registered every time the database connection is opened and closed and I don't want to have to mess with the ADO.NET provider code.

Re: [sqlite] "SQL logic error or missing database"

2006-05-24 Thread Ran
Actually, the multiple connections are created from different threads. But those threads did not access the database in the same moment when the problem occured, so I assumed (correctly) that the bug happens also when the connections are done from the same thread. And this is how I created the

[sqlite] updating with unique match

2006-05-24 Thread David Bicking
This is more an SQL than SQLITE question. I have two tables: (The relevant fields are) CREATE TABLE REQUESTS ( REQ_ID INTEGER PRIMARY KEY, CUST TEXT, AMOUNT FLOAT, PSREF TEXT) CREATE TABLE ACTUALS ( PSREF TEXT, CUST TEXT, AMOUNT FLOAT )

Re: [sqlite] Extra functions - New Project?

2006-05-24 Thread Roberto
On 24/05/06, Mikey C <[EMAIL PROTECTED]> wrote: Hi, I am in need of some new SQL functions and wanted to ask advice on the best way to integrate these functions into SQLite 3. I am not a proficient C coder unfortunately. What is the best way forward? Have someone develop these and add them

Re: [sqlite] Patch to let SQLite run on OS/2 again

2006-05-24 Thread drh
"Peter Weilbacher (Mozilla)" <[EMAIL PROTECTED]> wrote: > I am not really sure if this is the place to discuss this. But the > SQLite webpage doesn't list any developer related lists or contacts, so > I give it a try. > > We (that is mainly Daniel Lee Kruse, with a little bit of help from Andy

[sqlite] Patch to let SQLite run on OS/2 again

2006-05-24 Thread Peter Weilbacher (Mozilla)
I am not really sure if this is the place to discuss this. But the SQLite webpage doesn't list any developer related lists or contacts, so I give it a try. We (that is mainly Daniel Lee Kruse, with a little bit of help from Andy Willis and me) have re-ported SQLite to the OS/2 platform. My

Re: [sqlite] GROUP BY regression workaround?

2006-05-24 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > Anyone have any ideas how to speed up GROUP BY on huge views > in recent versions of SQLite? > > http://www.sqlite.org/cvstrac/tktview?tn=1809 > > The older versions of SQLite (prior to SQLite 3.2.6) used to > perform GROUP BY operations in the main

[sqlite] Extra functions - New Project?

2006-05-24 Thread Mikey C
Hi, I am in need of some new SQL functions and wanted to ask advice on the best way to integrate these functions into SQLite 3. I am not a proficient C coder unfortunately. I have compiled the source for 3.5.5 using Visual Studio.NET 2003 and all works fine. I have added a couple of simple

[sqlite] Re: - [sqlite] NOT NULL in create table command not work

2006-05-24 Thread rbundy
Are you confusing a NULL with an empty (zero length) string? They are not the same. Regards. rayB |-+> | | "Nguyen Dang | | | Quang" | | | <[EMAIL PROTECTED]| | | m>

[sqlite] NOT NULL in create table command not work

2006-05-24 Thread Nguyen Dang Quang
Hi guys, I used the following command to create table: create table ne(ne_id integer primary key autoincrement, name varchar(50) not null, directory varchar(256) not null, adaptor_name varchar(50) not null, note varchar(500), filter_rule varchar(50), unique(name), unique(directory)) But my