Re: [sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread Andrew Finkenstadt
On 6/1/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: > > On 5/31/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: > > On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: > > > > > > I realize that I didn't explain the problem well enough (thus is

Re: [sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread Andrew Finkenstadt
On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: On 5/31/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: > On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: > > > > I realize that I didn't explain the problem well enough (thus is the > > peril of being too close to it for a long time). > > > > I

Re: [sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread P Kishor
On 5/31/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: > > I realize that I didn't explain the problem well enough (thus is the > peril of being too close to it for a long time). > > I can have an (org <--> org) relationship or an (org <-->

Re: [sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread Andrew Finkenstadt
On 5/31/07, P Kishor <[EMAIL PROTECTED]> wrote: I realize that I didn't explain the problem well enough (thus is the peril of being too close to it for a long time). I can have an (org <--> org) relationship or an (org <--> person) relationship as well as a (person <--> person) relationship.

Re: [sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread P Kishor
On 5/31/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote: P Kishor <[EMAIL PROTECTED]> wrote: > I am modeling entities and their relationships to each other. A > classic network digraph kind of stuff. The entities are organizations > or persons. A person may be associated with none (org type >

[sqlite] [Wiki] How to register, and actually add a page?

2007-05-31 Thread Gilles Ganault
Hello I'd like to contribute to the wiki, but I didn't find... 1. How to register: There's no Register link in the Login page 2. How to actually add a page once I added a Camel-formatted word in a page. Thank you Gilles.

Re: [sqlite] Re: CAST

2007-05-31 Thread John Stanton
Robert Simpson wrote: -Original Message- From: John Stanton [mailto:[EMAIL PROTECTED] Sent: Thursday, May 31, 2007 4:08 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Re: CAST You have explained the problem, which is .NET not Sqlite. You have apparently done a fine job marrying

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
> How are you running this query? I am running this from Excel VBA with a free wrapper from Olaf Schmidt, dhSQLite, based on 3.3.17. I will check my code, but can't think of a way why it should add 100 with literals and not on table fields. Must admit I have been wrong before with these kind of

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
Sorry, forget about this, it was something in the VBA code, so nil to do with SQLite. Could I ask you how I would get the age in months? I can see it will be along similar lines, but maybe you have worked it out already. I need it to be full calendar months, so, if current date is 2007-05-31 then

Re: [sqlite] Age calculation on literal

2007-05-31 Thread Dennis Cote
RB Smissaert wrote: Thanks to Dennis Cote I got a nice way to get the age from the date in the form '-nmm-dd'. It works fine when I run it on a field, but when I run it on a literal date it gives me 100 too much: select case when date('2002-01-01', '+' || (strftime('%Y', 'now') -

[sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
Thanks to Dennis Cote I got a nice way to get the age from the date in the form '-nmm-dd'. It works fine when I run it on a field, but when I run it on a literal date it gives me 100 too much: select case when date('2002-01-01', '+' || (strftime('%Y', 'now') - strftime('%Y', '2002-01-01'))

[sqlite] Re: Inserting text string with quotes gives an error - php

2007-05-31 Thread Igor Tandetnik
Sabot <[EMAIL PROTECTED]> wrote: // so query looks like: INSERT INTO version (date,active,category,entry) VALUES ('2007-05-31 18:50','x','NOTE','test 'test' test'); The problem is of course with the last field, 'test 'test' test' . It's not valid SQL. If you want to put a single quote into a

Re: [sqlite] Inserting text string with quotes gives an error - php

2007-05-31 Thread Trey Mack
Inside string literals, escape single quotes with 2 single quotes 'test 'test' test' ==> 'test ''test'' test' When I try to insert text containg single quotes via php it gives me syntax error: ... // so query looks like: INSERT INTO version (date,active,category,entry) VALUES

[sqlite] Inserting text string with quotes gives an error - php

2007-05-31 Thread Sabot
Hi, I'm trying to find solution for my problem, searched archive but no results so posting here: When I try to insert text containg single quotes via php it gives me syntax error: $db = new SQLiteDatabase("notebook.sdb"); $query = "INSERT INTO version (date,active,category,entry) VALUES

RE: [sqlite] Re: CAST

2007-05-31 Thread Robert Simpson
> -Original Message- > From: John Stanton [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 31, 2007 4:08 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Re: CAST > > You have explained the problem, which is .NET not Sqlite. You have > apparently done a fine job marrying the two

Re: [sqlite] db design mixing different entities in the same table

2007-05-31 Thread Ken
Does a person ever belong to more than one organization? If so then use the following: Create table orgs ( org_id integer, org stuff); Create table Persons(person_id, person stuff); Create table persons_orgs(person_id, orig_id); The persons_orgs is a mapping table that allows one

Re: [sqlite] sqlite internal structs don't make use of C bitfields?

2007-05-31 Thread Ken
One needs to make use of CAS or LL/SC hardware instructions. These can be used to implement lock-free synchronization. Nuno Lucas <[EMAIL PROTECTED]> wrote: On 5/31/07, Eduardo Morras wrote: > At 23:25 30/05/2007, you wrote: > >Setting and reading individual bytes (u8 in sqlite-speak) are

[sqlite] Re: db design mixing different entities in the same table

2007-05-31 Thread Igor Tandetnik
P Kishor <[EMAIL PROTECTED]> wrote: I am modeling entities and their relationships to each other. A classic network digraph kind of stuff. The entities are organizations or persons. A person may be associated with none (org type "unassigned") or one organization, and, of course, an organization

Re: [sqlite] sqlite internal structs don't make use of C bitfields?

2007-05-31 Thread Nuno Lucas
On 5/31/07, Eduardo Morras <[EMAIL PROTECTED]> wrote: At 23:25 30/05/2007, you wrote: >Setting and reading individual bytes (u8 in sqlite-speak) are not >threadsafe either. Only reading/setting entire entire words >are threadsafe on most architectures. Using a uint32 for store the flags is

Re: [sqlite] Changing Schema On The Fly

2007-05-31 Thread Mitchell Vincent
Thanks Joe! I store "date" values as noon on the given day and toss out the time part to keep things like this from effecting my software. I appreciate the information though! On 5/31/07, Joe Wilson <[EMAIL PROTECTED]> wrote: Be aware of a Windows OS bug that prevents correct conversion of

[sqlite] db design mixing different entities in the same table

2007-05-31 Thread P Kishor
Not a SQLite-specific question per se, but a (SQLite) db design question. I am modeling entities and their relationships to each other. A classic network digraph kind of stuff. The entities are organizations or persons. A person may be associated with none (org type "unassigned") or one

Re: [sqlite] Re: CAST

2007-05-31 Thread Joe Wilson
--- John Stanton <[EMAIL PROTECTED]> wrote: > Sqlite lets you put in anything as the declared type. "DEAD PARROT", > "MONGOOSE", "GODZILLA" or "DECIMAL(6,1)" are all acceptable declared > types. Sqlite makes the underlying type TEXT if it is not obviously > numeric. The default affinity type

Re: [sqlite] Changing Schema On The Fly

2007-05-31 Thread Joe Wilson
Be aware of a Windows OS bug that prevents correct conversion of epoch integers to local date/time due to the recent US DST change: http://www.sqlite.org/cvstrac/tktview?tn=2322 Assuming you've applied the Windows OS DST patch, epoch-converted times can be off by an hour for pre-2007 dates in

Re: [sqlite] Changing Schema On The Fly

2007-05-31 Thread Mitchell Vincent
Yes, I've read that. The issue isn't with SQLite at all, actually, but with the ODBC driver. I guess the ODBC driver "trusts" SQLite's data type description because I have a field called "timestamp" that actually stores an epoch integer in it and ODBC-aware applications see the datatype as

Re: [sqlite] Re: CAST

2007-05-31 Thread John Elrick
John Stanton wrote: Sqlite lets you put in anything as the declared type. "DEAD PARROT", "MONGOOSE", "GODZILLA" or "DECIMAL(6,1)" are all acceptable declared types. Sqlite makes the underlying type TEXT if it is not obviously numeric. Thanks for the clarification. I wasn't aware of

Re: [sqlite] Re: CAST

2007-05-31 Thread John Stanton
John Elrick wrote: John Stanton wrote: John Elrick wrote: SNIP Introspection would occur via this mechanism and would even move all introspection for any given system behind a common interface. Just a thought. John Elrick CREATE TABLE already stores the type as its declared type.

Re: [sqlite] Changing Schema On The Fly

2007-05-31 Thread P Kishor
If you read you will see that, "Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes: NULL. The value is a NULL value. INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8

Re: [sqlite] Re: CAST

2007-05-31 Thread Michael Schlenker
John Elrick schrieb: John Stanton wrote: John Elrick wrote: SNIP Introspection would occur via this mechanism and would even move all introspection for any given system behind a common interface. Just a thought. John Elrick CREATE TABLE already stores the type as its declared type.

Re: [sqlite] Re: CAST

2007-05-31 Thread John Elrick
John Stanton wrote: John Elrick wrote: SNIP Introspection would occur via this mechanism and would even move all introspection for any given system behind a common interface. Just a thought. John Elrick CREATE TABLE already stores the type as its declared type. The user has that

Re: [sqlite] Re: CAST

2007-05-31 Thread John Stanton
John Elrick wrote: Michael Schlenker wrote: A. Pagaltzis schrieb: * Samuel R. Neff <[EMAIL PROTECTED]> [2007-05-30 14:55]: SQLite's typelessness is an asset if you work only with SQLite but in any application that uses multiple database engines of which SQLite is only one supported engine,

[sqlite] Changing Schema On The Fly

2007-05-31 Thread Mitchell Vincent
I have a set of databases that contain a date type called "timestamp". I need to make those "integer" so they come through the ODBC driver the right way. Is there any way to change all of that through queries on-the-fly? I'd like to avoid re-creating all the databases if possible.. Thanks! -- -

Re: [sqlite] Re: CAST

2007-05-31 Thread John Elrick
Michael Schlenker wrote: A. Pagaltzis schrieb: * Samuel R. Neff <[EMAIL PROTECTED]> [2007-05-30 14:55]: SQLite's typelessness is an asset if you work only with SQLite but in any application that uses multiple database engines of which SQLite is only one supported engine, the non-standard

Re: [sqlite] Equal distribution from random rows

2007-05-31 Thread John Elrick
Alex Teslik wrote: On Wed, 30 May 2007 15:18:18 -0400, John Elrick wrote After running a simple test, I confirmed a suspicion. VACUUM doesn't reorder the ROWIDs, so you still have breaks. My tests show otherwise: SNIP did I do something incorrectly? Not incorrectly,

[sqlite] SQLite used by Google Gears

2007-05-31 Thread Michael Ruck
This will cause SQLite to spread to even more desktops around the world: Google integrated SQLite into its new Google Gears tool, which allows web applications to work offline. It provides several services, one of which is a local client database. Read more: http://gears.google.com/ Mike

Re: [sqlite] How to restrict the peak heap usage during multiple inserts and updates?

2007-05-31 Thread John Stanton
Your design trade-off is memory against development time. It obviously depends upon your product. If you are making millions of them spend the time and save memory, otherwise add memory. If I used the method described earlier I would memory map it to a disk file if the underlying OS

Re: [sqlite] Re: CAST

2007-05-31 Thread John Stanton
You have explained the problem, which is .NET not Sqlite. You have apparently done a fine job marrying the two but it might be more logical to suggest that .NET be made more flexible. As for flexibility, programs in C or Assembler are only inflexible at the level of the underlying machine or

Re: [sqlite] Re: CAST

2007-05-31 Thread Michael Schlenker
A. Pagaltzis schrieb: * Samuel R. Neff <[EMAIL PROTECTED]> [2007-05-30 14:55]: SQLite's typelessness is an asset if you work only with SQLite but in any application that uses multiple database engines of which SQLite is only one supported engine, the non-standard typelessness is something that