[sqlite] What is a Relation?

2009-07-27 Thread CityDev
Just to kill time over coffee - what do you take the word to mean? I've just been reading a 1991 James Martin book on Object Orientation and he was using it to talk about links between entities. Chris Date was very specific that a relation was essentially a table. Mainly however, people seem to

Re: [sqlite] What is a Relation?

2009-07-27 Thread Darren Duncan
CityDev wrote: > Just to kill time over coffee - what do you take the word to mean? > > I've just been reading a 1991 James Martin book on Object Orientation and he > was using it to talk about links between entities. Chris Date was very > specific that a relation was essentially a table. Mainly

[sqlite] sqlite db5 error for symbian

2009-07-27 Thread Manasi Save
err = stmt.Prepare(db, _L("SELECT Col1 FROM tbl1 WHERE col2 = :var")); TInt paramIndex = stmt.ParameterIndex(_L(":var")); err = stmt.BindInt(paramIndex,user_id); id.AppendNum(user_id); iChitDemoAppUi->Log(id);

[sqlite] Problem with -order by- clause

2009-07-27 Thread Ralf
Hello, I’ve got a problem with sorting german ‚Umlaute’ eg. ’äöü’ (ae,oe,ue) Usually they are sorted prior to the corresponding Letter: ü before u In SqLite with ‘Collate Locale’ these letters are sorted at the end after ‘z’ Is there a solution or do I have to ‘live’ with it?

Re: [sqlite] Problem with -order by- clause

2009-07-27 Thread Martin.Engelschalk
Hi, The sorting used by default in sqlite uses normal strcmp - like comparison. This problem has been discussed several times in the mailing list: perhaps you want to search the archive. You will have to write your own collation, perhaps using the ICU. See

Re: [sqlite] Problem with -order by- clause

2009-07-27 Thread Igor Tandetnik
Martin.Engelschalk wrote: > The sorting used by default in sqlite uses normal strcmp - like > comparison. > > This problem has been discussed several times in the mailing list: > perhaps you want to search the archive. > You will have to write your own collation, perhaps using the ICU. > See

[sqlite] Generate scripts from SQLite database

2009-07-27 Thread Jadranko Dragoje
Hello, Is there some tool to generate scripts from SQLite database? I need to create scripts (create database, create table, triggers etc.) from existing database. Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Generate scripts from SQLite database

2009-07-27 Thread Swithun Crowe
Hello JD Is there some tool to generate scripts from SQLite database? I need to JD create scripts (create database, create table, triggers etc.) from JD existing database. >From the command line tool, the command .schema will output the commands used to create the database and all tables and

[sqlite] select query problem in symbian c++

2009-07-27 Thread rahul . makode
i am executing this query to get UserNamePasswordHash and i am setting value of variable UserID err = stmt.Prepare(db, _L("SELECT UserNamePasswordHash FROM User WHERE UserID=:UserID")); //TInt err = stmt.Prepare(database, _L("SELECT BinaryField FROM Tbl1"));

Re: [sqlite] Generate scripts from SQLite database

2009-07-27 Thread Jadranko Dragoje
Thank you, it works! On Mon, Jul 27, 2009 at 1:47 PM, Swithun Crowe < swit...@swithun.servebeer.com> wrote: > Hello > > JD Is there some tool to generate scripts from SQLite database? I need to > JD create scripts (create database, create table, triggers etc.) from > JD existing database. > >

Re: [sqlite] What is a Relation?

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Darren Duncan wrote: > Object orientation has nothing to do with all this per se, though objects > can easily be mapped to tuples. Darren, A related issue is that object orientation is almost always used in the context of procedural languages (e.g., C++, Python, Ruby)

Re: [sqlite] What is a Relation?

2009-07-27 Thread Jay A. Kreibich
On Sun, Jul 26, 2009 at 11:42:23PM -0700, CityDev scratched on the wall: > > Just to kill time over coffee - what do you take the word to mean? http://en.wikipedia.org/wiki/Relational_model A "relation" is a data structure that anyone familiar with SQL would call a table. It comes from

Re: [sqlite] What is a Relation?

2009-07-27 Thread CityDev
It's true that Codd and Date used the term 'relational' (They championed the N-ary Relational Model - others were around at the same time) but it's not easy to track the origin of the term in mathematics. Certainly the word implies joining things together. I guess the joining refers to fields

Re: [sqlite] What is a Relation?

2009-07-27 Thread Jean-Denis Muys
On 7/27/09 16:33 , "CityDev" wrote: > > it's not > easy to track the origin of the term in mathematics. For what it's worth (ie probably not much), my formal mathematics training in set theory taught me that a relation from a set A to a set B is a subset R of the

Re: [sqlite] What is a Relation?

2009-07-27 Thread Doug Currie
On Jul 27, 2009, at 10:33 AM, CityDev wrote: > It's true that Codd and Date used the term 'relational' (They > championed the > N-ary Relational Model - others were around at the same time) but > it's not > easy to track the origin of the term in mathematics.

[sqlite] Date Modifier '%w' Does Not Behave as INTEGER

2009-07-27 Thread Bill Welsh
I find that I must cast the result of a '%w' modifier to INTEGER to use it in a select. I have a table of TV programs that has title and an integer representing the show's start time as unix epoch. This does not produce any results, though I have shows beginning on Monday: select title,

Re: [sqlite] What is a Relation?

2009-07-27 Thread Beau Wilkinson
>> There are still people who just want >> a cursor to a chunk of data which they pull in and iterate over rather than >> use SQL's power to manage data a set-at-a-time I am dealing with such a project now. The schema consists of time stamp plus blob, where the blobs "map" directly to C++

Re: [sqlite] Date Modifier '%w' Does Not Behave as INTEGER

2009-07-27 Thread Pavel Ivanov
For me it's pretty obvious that strftime() returns text data type because it returns your date formatted as you like. And SQLite have never compared text and integer as equal even if they have the same notation when converted to text: sqlite> select 1 where '1' = 1; sqlite> select 1 where '1' =

Re: [sqlite] What is a Relation?

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Beau Wilkinson wrote: > I am dealing with such a project now. The schema consists of time stamp > plus blob, where the blobs "map" directly to C++ structs. Of course, there > are all sorts of useful data items in those blobs, and many of the > capabilities of SQL are lost by

Re: [sqlite] What is a Relation?

2009-07-27 Thread Beau Wilkinson
>> Rich Shepard wrote: >>What is more unfortunate is when someone with greater knowledge takes over >> a project but is prevented from re-doing it in a more efficient way because >> someone else's ego will be bruised or the powers that be cannot appreciate >> the need. I think my knowledge is

[sqlite] SQLite lock behavior in shared-cache mode

2009-07-27 Thread Alessandro Merolli
Hi, I'm using SQLite latest version (3.6.16) with shared-cache enable in a process that has around 5 threads. Database connections for each thread are created with the same main database file. After that, each connection is attached to a particular database file (one for each

Re: [sqlite] SQLite lock behavior in shared-cache mode

2009-07-27 Thread Dan
While compiling any statement (sqlite3_prepare_v2()), or while stepping (sqlite3_step()) a statement that accesses the main database, a mutex associated with the in-memory cache of the main database will be held. Dan. On Jul 27, 2009, at 11:16 PM, Alessandro Merolli wrote: > Hi, > >

Re: [sqlite] What is a Relation?

2009-07-27 Thread Simon Slavin
On 27 Jul 2009, at 2:49pm, Jay A. Kreibich wrote: > That's because most people are, unfortunately, taught SQL in a vacuum > with none of the theory or background. Yes yes. Hence the recent rash of people on this list who can't dry- run their software, don't understand what an index is,

Re: [sqlite] SQLite lock behavior in shared-cache mode

2009-07-27 Thread Alessandro Merolli
Thanks again Dan for the quick response. I understood. Is this also true for any other database file attached to these threads connections that, as the main.db file, are used for read-only operations but might have one or more threads reading from it at the same time? Alessandro. On

Re: [sqlite] SQLite lock behavior in shared-cache mode

2009-07-27 Thread Jim Showalter
Does SQLite support MVCC (http://en.wikipedia.org/wiki/Multiversion_concurrency_control)? It sounds like it doesn't. Maybe it should--that's a very nice way to support unblocked reads while still getting mutex for writes. - Original Message - From: "Dan" To:

[sqlite] How to disable fsync() in SQLite

2009-07-27 Thread W.-H. Gu
Hi, Is there a way to disable fsync() in my SQLite application on Linux? I saw a discussion of SQLite performance at http://www.sqlite.org/speed.htmland it has some results with option 'nosync.' I am wondering if I can do the same thing as there to see how fsync() effects the performance in my

Re: [sqlite] How to disable fsync() in SQLite

2009-07-27 Thread Pavel Ivanov
Execute pragma synchronous = off; after opening connection to database. More info: http://www.sqlite.org/pragma.html#pragma_synchronous. Pavel On Mon, Jul 27, 2009 at 2:31 PM, W.-H. Gu wrote: > Hi, > >   Is there a way to disable fsync() in my SQLite application on Linux?

Re: [sqlite] How to disable fsync() in SQLite

2009-07-27 Thread Petite Abeille
On Jul 27, 2009, at 8:31 PM, W.-H. Gu wrote: > Is there a way to disable fsync() pragma synchronous = off http://www.sqlite.org/pragma.html#pragma_synchronous -- PA. http://alt.textdrive.com/nanoki/ ___ sqlite-users mailing list

Re: [sqlite] What is a Relation?

2009-07-27 Thread Paul Claessen
So .. would anyone know a good book for seasoned programmers, who are new to databases, that addresses all these issues? ~ Paul Claessen > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon > Slavin > Sent: Monday,

Re: [sqlite] What is a Relation?

2009-07-27 Thread Darren Duncan
Rich Shepard wrote: > On Mon, 27 Jul 2009, Darren Duncan wrote: >> Object orientation has nothing to do with all this per se, though objects >> can easily be mapped to tuples. > >A related issue is that object orientation is almost always used in the > context of procedural languages (e.g.,

[sqlite] Performance tuning the Lookaside memory allocator

2009-07-27 Thread Shaun Seckman (Firaxis)
Hello, I'm in the process of tuning my allocators such that the fixed buffers will be enough to prevent any overflow from occuring. I've been using the memory statistics to tweak the page cache, and scratch buffers accordingly but found that there are no such mechanisms for

Re: [sqlite] What is a Relation?

2009-07-27 Thread John Elrick
Beau Wilkinson wrote: >>> There are still people who just want >>> a cursor to a chunk of data which they pull in and iterate over rather than >>> use SQL's power to manage data a set-at-a-time >>> > > I am dealing with such a project now. The schema consists of time stamp plus > blob,

[sqlite] totally OT: debunking debunking SQL

2009-07-27 Thread P Kishor
caution: this thread has a very high probability of veering into the subjective and the incoherent, and veer far away from SQLite, nevertheless... from the recent thread on "what is a relation," I followed Jay's suggestion and started reading up on relational division (an article by Celko at

Re: [sqlite] What is a Relation?

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Paul Claessen wrote: > So .. would anyone know a good book for seasoned programmers, who are new > to databases, that addresses all these issues? Paul, Any of Joe Celko's books. His "SQL Programming Style" is particularly good for an overview. The amazon.com listing lets

[sqlite] Denormalisation

2009-07-27 Thread CityDev
I did a Computer Science MSc 30 years ago specialising in databases (the relational model was only in prototypes). Of course normalisation was well known, but what people would say is normalising is the easy part; the skill comes in 'collapsing'. More recently the term 'denormalise' has been used

[sqlite] DATETIME and storage type

2009-07-27 Thread Rael Bauer
Hi,   If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table "notes" add column "last_modified" DATETIME default "2001-01-01";) will the declared default value be stored as a string or real value?   Also, more generally, how can I find out what storage type field values have

Re: [sqlite] totally OT: debunking debunking SQL

2009-07-27 Thread CityDev
Codd had his 'extended relational model' and I think Chris Date has got the Third Manifesto. Unfortunately people can't be satisfied they've invented something really, really simple and just feel proud, they want to become professors and write impenetrably clever papers that only their colleagues

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread P Kishor
On Mon, Jul 27, 2009 at 4:45 PM, Rael Bauer wrote: > Hi, > > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will the > declared default value be stored as a string or real value?

[sqlite] Still have high cpu usage when deleting old data with indices

2009-07-27 Thread W.-H. Gu
Hi, In my C application, I create a table and insert 32 rows every second. Each row has about 28KB. Every 5 seconds, it deletes old rows with timestamp <= current time - PERIOD. I did create an index on the column 'timestamp,' but I observed that every 5 seconds, cpu usage hits up to 9%.

Re: [sqlite] Denormalisation

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, CityDev wrote: > Over the intervening years I can't ever remember denormalising data (even > when dealing with eg 13 million insurance customers in a table). Is it OK > nowadays to say always aim to be fully normalised - modern RDBMSs are > usually powerful enough to cope

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Rael Bauer wrote: > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will > the declared default value be stored as a string or real value? Rael, String (the actual data storage

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Rael Bauer wrote: > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will > the declared default value be stored as a string or real value? Rael, What you have above is data

Re: [sqlite] totally OT: debunking debunking SQL

2009-07-27 Thread Darren Duncan
(Top-posting, sorry.) What gives is that dbdebunk.com is effectively a fanboy site that has gone too far and it should generally be ignored; it is not official and has about as much to do with Date or The Third Manifesto as a rabid fan site for some TV show or sport has to do with the

Re: [sqlite] Denormalisation

2009-07-27 Thread Simon Slavin
On 27 Jul 2009, at 10:44pm, CityDev wrote: > Over the intervening years I can't ever remember denormalising data > (even > when dealing with eg 13 million insurance customers in a table). Is > it OK > nowadays to say always aim to be fully normalised - modern RDBMSs are > usually powerful

Re: [sqlite] What is a Relation?

2009-07-27 Thread Darren Duncan
Paul Claessen wrote: > So .. would anyone know a good book for seasoned programmers, who are new to > databases, that addresses all these issues? I suggest one of C. J. Date's latest works: See http://oreilly.com/catalog/9780596523060/ . SQL and Relational Theory How to Write Accurate SQL Code

Re: [sqlite] Still have high cpu usage when deleting old data with indices

2009-07-27 Thread Simon Slavin
On 27 Jul 2009, at 11:09pm, W.-H. Gu wrote: > In my C application, I create a table and insert 32 rows every > second. > Each row has about 28KB. Every 5 seconds, it deletes old rows with > timestamp > <= current time - PERIOD. I did create an index on the column > 'timestamp,' > but I

Re: [sqlite] totally OT: debunking debunking SQL

2009-07-27 Thread Simon Slavin
On 27 Jul 2009, at 10:49pm, CityDev wrote: > Codd had his 'extended relational model' and I think Chris Date has > got the > Third Manifesto. Unfortunately people can't be satisfied they've > invented > something really, really simple and just feel proud, they want to > become > professors

Re: [sqlite] What is a Relation?

2009-07-27 Thread Simon Slavin
On 27 Jul 2009, at 7:37pm, Paul Claessen wrote: > So .. would anyone know a good book for seasoned programmers, who > are new to databases, that addresses all these issues? If you're a seasoned programmer you probably don't need my advice. The problem is not databases, it's an

Re: [sqlite] Denormalisation

2009-07-27 Thread BareFeet
> Is it OK nowadays to say always aim to be fully normalised - modern > RDBMSs are usually powerful enough to cope with most anything? I suggest that aiming for fully normalised databases is the way to go, for the traditional and still relevant reasons of data integrity, file size,

Re: [sqlite] Denormalisation

2009-07-27 Thread Jim Showalter
Try writing apps for cellphones and both space and time become important again! - Original Message - From: "Simon Slavin" To: "General Discussion of SQLite Database" Sent: Monday, July 27, 2009 3:33 PM Subject: Re: [sqlite]

[sqlite] hi - sqlite3 advantages

2009-07-27 Thread An
Hi ! SQLite is a really cool database... I currently still use version 2... I would like the insight of whoever feels like it of some advantages of version 3 over version 2 maybe i get convinced on the importance to make the version evolution, or possible mayor advantages ; ) Thank you,

[sqlite] How to dump cookies.sqlite

2009-07-27 Thread Mutiullah Qureshi
Hello friends. I have downloaded sqlite3-3.6.16.bin.gz and extracted sqlite3-3.6.16.bin in fedora 9. Now I want to dump cookies.sqlite from mozila firefox cache to cookies.tmp. I have tried: sqlite> .dump cookies.sqlite cookies.tmp BEGIN TRANSACTION; COMMIT; sqlite> But this does not create

Re: [sqlite] Denormalisation

2009-07-27 Thread Jay A. Kreibich
On Mon, Jul 27, 2009 at 02:44:08PM -0700, CityDev scratched on the wall: > > More recently the term 'denormalise' has been used > instead. This is where you repeat foreign data in a table to avoid the > overhead of joins at runtime. > Over the intervening years I can't ever remember