Re[2]: [sqlite] the 3 numerical types (was Re: Problem/Bug: "SELECT 5 / 2;" returns 2 ?)

2005-09-29 Thread Doug Currie
Thursday, September 29, 2005, 10:12:44 PM, Dennis Cote wrote: > On 9/29/05, Darren Duncan <[EMAIL PROTECTED]> wrote: >[...] >>> 2. DECIMAL(p,s) - An exactly remembered fractional number that is >> typically stored in a form akin to text, such as one byte per base-10 >> digit. These can

Re: [sqlite] the 3 numerical types (was Re: Problem/Bug: "SELECT 5 / 2;" returns 2 ?)

2005-09-29 Thread Dennis Cote
On 9/29/05, Darren Duncan <[EMAIL PROTECTED]> wrote: > > At 11:07 AM -0600 9/29/05, Dennis Cote wrote: > >As you can see, the result of exact (integer) division is also exact > >(integer) with implementation defined precision and scale. The > >result of an expression containing approximate

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Clark Christensen
SQL*Plus: Release 8.1.7.0.0 - Production on Thu Sep 29 16:03:55 2005 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production SQL> select

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Alexander J. Kozlovsky
> Unfortunately, this is not true for SQLite3. If you execute the following SQL > commands > > CREATE TABLE t (a REAL, b REAL); > INSERT INTO t VALUES (5, 2); > > both values are stored as INTEGER and not as REAL as one would expect > by the column affinity. In fact, this behaviour is

Re: [sqlite] the 3 numerical types (was Re: Problem/Bug: "SELECT 5 / 2;" returns 2 ?)

2005-09-29 Thread Jay Sprenkle
On 9/29/05, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > > True mathematically but not in practice. All fractional numbers are > represented as floating point, therefore there are no exact fractional > numbers on any SQL implementations I am aware of. It's possible > to do, but I've never seen it

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Jay Sprenkle
On 9/29/05, Ralf Junker <[EMAIL PROTECTED]> wrote: > > Unfortunately, this is not true for SQLite3. If you execute the following > SQL commands > > CREATE TABLE t (a REAL, b REAL); > INSERT INTO t VALUES (5, 2); > > both values are stored as INTEGER and not as REAL as one would expect by > the

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Jay Sprenkle
On 9/29/05, Ralf Junker <[EMAIL PROTECTED]> wrote: > > Another problem shows when calculations are not performed on colums with > type affinity but just on plain numbers like in > > SELECT 5 / 2; > > What exactly is intended? From the findings above, both numbers might be > seen as INTEGERs, but

[sqlite] the 3 numerical types (was Re: Problem/Bug: "SELECT 5 / 2;" returns 2 ?)

2005-09-29 Thread Darren Duncan
At 11:07 AM -0600 9/29/05, Dennis Cote wrote: As you can see, the result of exact (integer) division is also exact (integer) with implementation defined precision and scale. The result of an expression containing approximate (floating point) values is approximate (floating point). So SQLite

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Lawrence Chitty
Ralf Junker wrote: In risk of asking the obvious, I wonder if the following division should be considered correct: | Query | Result Value | Result Type| OK? --- 1 | SELECT 5 / 2; | 2| SQLITE_INTEGER | No?

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Dennis Jenkins
Just out of curiosity: Maybe someone can report the result of 'SELECT 5 / 2;' on MySql, SQLServer, and others? devl=# SELECT 5 / 2; ?column? -- 2 (1 row) devl=# select 5.0 / 2; ?column? 2.5000 (1 row) devl=# select 5 / 2.0;

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Ralf Junker
Hello Dennis & Jay, thanks for your detailed answers. I do understand your arguments and they make good sense for typed DB engines, but for the case of SQLite3 I dare to differ. >This can be fixed by checking the column affinity for a value when it is >stored. If an integer value is being

Re: [sqlite] Tool to load a database and see all tables and fields.

2005-09-29 Thread Tom Melendez
What didn't you like about SQLiteManager? I have found the developer very responsive to bug fixes, requests and patches, so I would recommend detailing things that you didn't like or didn't work correctly for you and sending it to him. At the time that I was actively looking, I found it to be

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Dennis Cote
Ralf Junker wrote: In risk of asking the obvious, I wonder if the following division should be considered correct: | Query | Result Value | Result Type| OK? --- 1 | SELECT 5 / 2; | 2| SQLITE_INTEGER | No?

Re: [sqlite] Getting CVS source without CVS

2005-09-29 Thread Dennis Cote
Brandon, Nicholas wrote: Hi, It there a way to download the latest source from CVS without using the CVS tool? I only have access to the internet through HTTP/FTP and via a company proxy. Nicholas, Its not pretty, but you could download the latest released source from the download page

[sqlite] User-defined Collating Sequences

2005-09-29 Thread Martin Pfeifle
Hi, does anybody know whether a code example for User-defined Collating Sequences in C exists, and where I can find such an example. Or even better has somebody already implemented such a User-defined Collating Sequence taking German Umlaute into account. Best Martin

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-09-29 Thread Jay Sprenkle
In the C language, which sqlite is written in, performs math this way: If mixing types the operands are converted to the most precise type and the operation evaluated. => SELECT 5 / 2; is: integer operation integer the most precise type is integer, so it's strictly integer math. evaluated as

Re: [sqlite] Database is locked Query

2005-09-29 Thread Jay Sprenkle
On 9/29/05, Gaurav Patole <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a database file placed onto a NTFS LAN based local server. > Application's on different machines tries to access this database file and > update it frequently. from: http://www.sqlite.org/cvstrac/wiki?p=WhenToUseSqlite

[sqlite] Database is locked Query

2005-09-29 Thread Gaurav Patole
Hello, I have a database file placed onto a NTFS LAN based local server. Application's on different machines tries to access this database file and update it frequently. I am using Christian Werner's ODBC Driver. I am facing "Database is locked" problem. * Is concurrency weak in

[sqlite] How to compile sqlite .net dll

2005-09-29 Thread Matheus Ledesma
Hi, I'd like to know how could I customize the features of sqlite and compile it in a dll like the one I use in my .net app that is the one that I've download pre-compiled from the sqlite website. Regards, Matheus Ledesma Systems Analyst - Industrial Automation Garten Engenharia Rua Barão

[sqlite] Getting CVS source without CVS

2005-09-29 Thread Brandon, Nicholas
Hi, It there a way to download the latest source from CVS without using the CVS tool? I only have access to the internet through HTTP/FTP and via a company proxy. Regards Nick This email and any attachments are confidential

Re: [sqlite] Rewriting a query

2005-09-29 Thread Hugh Gibson
> I'm intrigued. How do you get SQLite to use a multi-column index as it's > primary key (i.e. B-tree hash)? Please elaborate. Simply CREATE TABLE TransactionList (sTransactionID Text(13) DEFAULT '',sCommunityID Text(13) DEFAULT '',sObject Text(13) , PRIMARY KEY (sCommunityID,

Re: [sqlite] Rewriting a query

2005-09-29 Thread Robin Breathe
Hugh Gibson wrote: >> What happens if you create the index on sCommunityID only? Does >> it still do the full table scan? > > A bit difficult to drop the (sCommunityID, sTransactionID) index, as it's > the primary key. I'm intrigued. How do you get SQLite to use a multi-column index as it's

Re: [sqlite] Tool to load a database and see all tables and fields.

2005-09-29 Thread Ralf Junker
Hello Eno Thereska, >Is there a version for Linux? So far I have only found slqbrowser being >useful/free free Linux. No, SQLiteSpy is only available for Win32. >Sqlitespy for windows looks pretty nice, btw. Thanks, it's much appreciated. Regards, Ralf