Re: [sqlite] Accessing sqlite using javascript

2009-05-19 Thread Saurabh Pawar
This is the best link i have found out till now which will give a very clear view. https://developer.mozilla.org/en/Storage It helped me a lot.Hope it helps you too. - Original Message From: Saurabh Pawar To: sql...@surfulater.com; General Discussion of

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Dennis Cote
Allen Fowler wrote: > I have several CGI and cron scripts and that I would like coordinate via a > "First In > / First Out" style buffer.That is, some processes are adding work > units, and some take the oldest and start work on them. > > Could SQLite be used for this? > > It would seem

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Kees Nuyt wrote: Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset before it can return the first row in the resultset. Need I say more? http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor Thank you for the link, it is a VERY useful read, VERY useful! Sam

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Kees Nuyt
On Tue, 19 May 2009 11:26:31 -0400, Sam Carleton wrote: >Marco Bambini wrote: >> SELECT ... LIMIT 1; >> >Marco, Is this to say that adding the LIMIT 1 does make it more efficient? Not necessarily. Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Simon Slavin
On 19 May 2009, at 4:26pm, Sam Carleton wrote: > Marco Bambini wrote: >> SELECT ... LIMIT 1; >> > Marco, Is this to say that adding the LIMIT 1 does make it more > efficient? LIMIT does not make the query (much) more efficient: the software still needs to do the same filtering and sorting,

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Christopher Taylor
-- From: "Douglas E. Fajardo" Sent: Tuesday, May 19, 2009 11:57 AM To: "'General Discussion of SQLite Database'" Subject: Re: [sqlite] Sqlite as a FIFO buffer? > One-per-second sounds *very* slow - I

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Doug Currie
On May 19, 2009, at 10:05 AM, Jean-Denis Muys wrote: > On 5/19/09 2:44 PM, "Igor Tandetnik" wrote: >> >> Wikipedia gives a definition different from yours, for what it's >> worth: >> >> http://en.wikipedia.org/wiki/Remainder#The_case_of_general_integers > > Also to

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Douglas E. Fajardo
One-per-second sounds *very* slow - I think I was getting around 10 per second in my application, although usage patterns may account for the difference. The main cause of the slowdown (IMHO) is inherent in ensuring that changes are written to physical disk. There are some pragmas that change

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Marco Bambini wrote: SELECT ... LIMIT 1; Marco, Is this to say that adding the LIMIT 1 does make it more efficient? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Marco Bambini
SELECT ... LIMIT 1; -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On May 19, 2009, at 5:03 PM, Sam Carleton wrote: > I am far from a SQL expert, but I am 99.9% sure there is SQL syntax > to limit > the number of results, I have not looked it up but I will in

[sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
I am far from a SQL expert, but I am 99.9% sure there is SQL syntax to limit the number of results, I have not looked it up but I will in a little while... I only need one result. Since I am working with the C/C++ API, I plan to simply call sqlite3_step() only once. Is there any point in using

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Jean-Denis Muys
On 5/19/09 2:44 PM, "Igor Tandetnik" wrote: > > Wikipedia gives a definition different from yours, for what it's worth: > > http://en.wikipedia.org/wiki/Remainder#The_case_of_general_integers Also to support my version, the same article says a bit later: " Usually, in

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Jean-Denis Muys
On 5/19/09 2:44 PM, "Igor Tandetnik" wrote: > > Well then, for the equality to hold, (-1)/7 should be -1. Would you be > happy with such an outcome? > Yep > Wikipedia gives a definition different from yours, for what it's worth: > >

[sqlite] sqlite3_exec(): errmsg parameter

2009-05-19 Thread chandan
Hi, if sqlite3_exec() returns an error code (i.e other than SQLITE_OK), is it guaranteed that the "errmsg" argument always contains the error message string. Or should i compare the value of errmsg with NULL before printing the value? E.g: ret = sqlite3_exec(db, sql, NULL, NULL, _msg); if

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread John Machin
On 19/05/2009 9:57 PM, Igor Tandetnik wrote: > "John Machin" wrote > in message news:4a129cb4.2090...@lexicon.net >> It's handy for checking how things work e.g. >> >> sqlite> select (-1) % 7; >> -1 >> sqlite> -- it's not a real modulo operator :-( > > What do you feel is

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Emil Obermayr
On Tue, May 19, 2009 at 02:06:37PM +0200, Jean-Denis Muys wrote: > > There exists unique natural numbers q and r such as: > > a = b*q+r > 0 <= r < b > > q is defined as the quotient, r is defined as the remainder. > > So if the % operator wants to match that math definition, its results should

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Igor Tandetnik
"Jean-Denis Muys" wrote in message news:c6386d6d.45a7%jdm...@kleegroup.com > On 5/19/09 1:57 PM, "Igor Tandetnik" > wrote: > >> "John Machin" >> wrote in message >> news:4a129cb4.2090...@lexicon.net >>> It's handy for checking how

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Nuno Lucas
On Tue, May 19, 2009 at 12:49 PM, John Machin wrote: > It's handy for checking how things work e.g. > > sqlite> select (-1) % 7; > -1 > sqlite> -- it's not a real modulo operator :-( I also used it as: sqlite> .mode col sqlite> .h 1 sqlite> select "€", length("€"),

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Jean-Denis Muys
My memory failed me on a detail if I want to be rigorous. In the definition of q and r, r is a natural number, but q is a relative number, not a natural. On 5/19/09 2:06 PM, "Jean-Denis Muys" wrote: > On 5/19/09 1:57 PM, "Igor Tandetnik" wrote: > >>

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Jean-Denis Muys
On 5/19/09 1:57 PM, "Igor Tandetnik" wrote: > "John Machin" wrote > in message news:4a129cb4.2090...@lexicon.net >> It's handy for checking how things work e.g. >> >> sqlite> select (-1) % 7; >> -1 >> sqlite> -- it's not a real modulo operator :-( >

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Igor Tandetnik
"John Machin" wrote in message news:4a129cb4.2090...@lexicon.net > It's handy for checking how things work e.g. > > sqlite> select (-1) % 7; > -1 > sqlite> -- it's not a real modulo operator :-( What do you feel is wrong with this result? What should a "real" modulo

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread John Machin
On 19/05/2009 9:37 PM, Nuno Lucas wrote: > On Mon, May 18, 2009 at 5:03 PM, Mitchell L Model wrote: >> I may be misreading the select-core diagram on >> http://www.sqlite.org/lang_select.html but it appears that the down-arrow >> that would allow a query without a FROM clause

Re: [sqlite] column names

2009-05-19 Thread John Machin
On 19/05/2009 6:47 PM, Chanas, Olivier wrote: > Hi all, > > I would like to know what are the allowed characters to build a column name. > Is there some limitation ? OTTOMH (because it's not all in one convienient place in the docs): This applies to names of columns, tables, triggers, indexes,

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Nuno Lucas
On Mon, May 18, 2009 at 5:03 PM, Mitchell L Model wrote: > I may be misreading the select-core diagram on > http://www.sqlite.org/lang_select.html  but it appears that the down-arrow > that would allow a query without a FROM clause should not be there. Is it > really possible to

[sqlite] column names

2009-05-19 Thread Chanas, Olivier
Hi all, I would like to know what are the allowed characters to build a column name. Is there some limitation ? Thanks in advance ? +33 476 14 6656 > olivier.cha...@hp.com ? GMT +1 Hewlett-Packard - 5 av R Chanas, Eybens - 38053 Grenoble Cedex 9 - France

[sqlite] error in documentation of SELECT?

2009-05-19 Thread Mitchell L Model
I may be misreading the select-core diagram on http://www.sqlite.org/lang_select.html but it appears that the down-arrow that would allow a query without a FROM clause should not be there. Is it really possible to have a SELECT with no FROM? If so, could someone provide an example; if not,

Re: [sqlite] memory occupied by columns with NULL value

2009-05-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 chandan wrote: > I would like to know how much memory is used for a record field > whose value is NULL. The file format is documented at http://www.sqlite.org/fileformat.html with the specific information in section 2.3.2 - a null is stored as

Re: [sqlite] memory occupied by columns with NULL value

2009-05-19 Thread John Machin
On 19/05/2009 6:25 PM, chandan wrote: > Hi, > I would like to know how much memory is used for a record field > whose value is NULL. http://www.sqlite.org/fileformat.html ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] memory occupied by columns with NULL value

2009-05-19 Thread chandan
Hi, I would like to know how much memory is used for a record field whose value is NULL. Regards, chandan ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users