Re: [sqlite] sql function to change multiple links within a DB

2011-08-31 Thread teahou
Simon Slavin-3 wrote: > > > On 1 Sep 2011, at 12:37am, teahou wrote: > >> The closest I have come is to do it in parts, I came up with this: >> >> UPDATE questions SET answer = REPLACE(answer, ' style="text-decoration: >> underline; color: blue" >>

Re: [sqlite] sql function to change multiple links within a DB

2011-08-31 Thread Simon Slavin
On 1 Sep 2011, at 12:37am, teahou wrote: > The closest I have come is to do it in parts, I came up with this: > > UPDATE questions SET answer = REPLACE(answer, ' style="text-decoration: underline; color: blue" > onclick="Ti.App.fireEvent(''openContent'', {kind: ''FAQ'', find: "' ); > > As you

[sqlite] sql function to change multiple links within a DB

2011-08-31 Thread teahou
Hello. I am doing some work on a SQLite table with just over 5000 rows. One column holds some html text with links within, and I need to change every one of those links to a new format. A sample link looks like this: /FAQ/Doctors Doctors We will call the 'FAQ' portion of the link, the

Re: [sqlite] (no subject)

2011-08-31 Thread Igor Tandetnik
On 8/31/2011 5:56 PM, Tim Streater wrote: In the above, each database is newly created as shown. What I had forgotten to do was to create the "test" table in the second database before copying the data. What seems to happen is that, lacking a "test" table in the test2 database, SQLite appears to

Re: [sqlite] (no subject)

2011-08-31 Thread Jay A. Kreibich
On Wed, Aug 31, 2011 at 10:56:00PM +0100, Tim Streater scratched on the wall: > In the above, each database is newly created as shown. What I had > forgotten to do was to create the "test" table in the second > database before copying the data. What seems to happen is that, > lacking a "test"

[sqlite] (no subject)

2011-08-31 Thread Tim Streater
Today when trying to copy from one database to another, I had the following error (simplified example below): Second-Mini% sqlite3 test1 sqlite> create table test (absid integer primary key, otherfield integer); sqlite> insert into test (absid,otherfield) values (null, 10); sqlite>

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Kees Nuyt
On Wed, 31 Aug 2011 08:12:10 -0400, "Igor Tandetnik" wrote: >Ivan Shmakov wrote: >>> Tobias Vesterlund writes: >>> Is it possible to get the highest value in a "limited column" when >>> using LIMIT? >> >> Sure. >> >> SELECT max (id) FROM (SELECT

Re: [sqlite] System.Data.SQLite Release

2011-08-31 Thread Joe Mistachkin
> > Just wondering when the next release of System.Data.SQLite will be > available. > My current plan is to produce a release before the 15th of September. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Ivan Shmakov
> Igor Tandetnik writes: > Ivan Shmakov wrote: > Tobias Vesterlund writes: >>> Is it possible to get the highest value in a "limited column" when >>> using LIMIT? >> Sure. >> SELECT max (id) FROM (SELECT id FROM t WHERE id > 0 LIMIT 10); > This only

[sqlite] System.Data.SQLite Release

2011-08-31 Thread Patrick Earl
Just wondering when the next release of System.Data.SQLite will be available. There's a bug, that was already reported and fixed, in the current release that badly breaks NHibernate / ActiveRecord. Patrick Earl ___ sqlite-users mailing list

Re: [sqlite] How to configure any parameter to set max number of records to be added in SQLite DB

2011-08-31 Thread Richard Hipp
On Tue, Aug 30, 2011 at 11:55 PM, Tarun wrote: > Hi All, > > Is there any configurable parameter which allows us to set maximum > number of records that is allowed to be inserted. Once this limit is > reached, insert SQL query should fail inserting records telling max >

Re: [sqlite] Clarification about Triggers

2011-08-31 Thread Black, Michael (IS)
Not accusing you of being pompous/patronizing at all...just having some fun with it... I prefer the Pluralis Majestatis interpretation myself:-) http://en.wikipedia.org/wiki/We Shall we agree? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate

Re: [sqlite] Clarification about Triggers

2011-08-31 Thread Dan Kennedy
On 08/31/2011 06:34 PM, Black, Michael (IS) wrote: Doohyes "we" missed that. But shouldn't new.rowid be undefined then rather than return -1? Much like old.rowid is undefined? That might have helped "us" in recognizing "our" mistake. Fair enough. Sounded pompous. I say "we" because I

Re: [sqlite] SQLite3 linking error on 64 bit linux machine

2011-08-31 Thread Tarun
Hi Igor, Thanks for reply. This issue is resolved. I downloaded source code sqlite-autoconf-3070701.tar.gz and built on 64 bit machine. It built successfully and I am able to link with it. Thanks and Regards, Tarun On 8/31/11, Igor Tandetnik wrote: > Tarun

Re: [sqlite] EXT : SQLite3 linking error on 64 bit linux machine

2011-08-31 Thread Black, Michael (IS)
Just download the amalgamation and include sqlite3.c and sqlite3.h in your project. Much easier than trying to mess with shared libraries which you probably don't need anyways. That would be the zip file on here: http://www.sqlite.org/download.html Michael D. Black Senior Scientist

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Simon Slavin
On 31 Aug 2011, at 8:38am, Tobias Vesterlund wrote: > Is it possible to get the highest value in a "limited column" when using > LIMIT? Sort by that value. For instance, SELECT id FROM t ORDER BY id DESC LIMIT 1 will give you the biggest value of 'id' that can be found. It's not needed in

Re: [sqlite] SQLite3 linking error on 64 bit linux machine

2011-08-31 Thread Igor Tandetnik
Tarun wrote: > I am trying to use SQLite3 library on 64 bit machine. I have copied > libsqlite3.so from /usr/lib/ on 32bit linux machine to 64bit linux > machine. How do you expect this to work? The library from 32-bit machine contains 32-bit code. You can't link that

[sqlite] SQLite3 linking error on 64 bit linux machine

2011-08-31 Thread Tarun
Hi All, I am trying to use SQLite3 library on 64 bit machine. I have copied libsqlite3.so from /usr/lib/ on 32bit linux machine to 64bit linux machine. While program compilation on 64bit machine, I am getting linking error given below:

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Igor Tandetnik
Tobias Vesterlund wrote: > But If I do SELECT max(id) FROM t WHERE id > 0 LIMIT 10; it will return 99. > > My logic, which may be flawed in this case, tells me the third SELECT should > return 10 and not 99. > > Is it possible to get the highest value in a

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Igor Tandetnik
Ivan Shmakov wrote: >> Tobias Vesterlund writes: >> Is it possible to get the highest value in a "limited column" when >> using LIMIT? > > Sure. > > SELECT max (id) FROM (SELECT id FROM t WHERE id > 0 LIMIT 10); This only works by accident. There's no requirement

Re: [sqlite] Clarification about Triggers

2011-08-31 Thread Black, Michael (IS)
Doohyes "we" missed that. But shouldn't new.rowid be undefined then rather than return -1? Much like old.rowid is undefined? That might have helped "us" in recognizing "our" mistake. The docs say The value of NEW.rowid is undefined in a BEFORE INSERT trigger in which the rowid is not

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Kees Nuyt
On Wed, 31 Aug 2011 09:38:46 +0200, Tobias Vesterlund wrote: > Hi, > > I'm want to get the max value out of a certain column in a table. > > Table t has a column named id, which ranges from 0 to 99. > > If I do SELECT max(id) FROM t; > it will return 99. > If I

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Tobias Vesterlund
Right you are, thank you! Regards, Tobias -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ivan Shmakov Sent: den 31 augusti 2011 10:13 To: sqlite-users@sqlite.org Subject: Re: [sqlite] max() with LIMIT > Tobias

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Ivan Shmakov
> Tobias Vesterlund writes: […] > If I do SELECT max(id) FROM t; it will return 99. > If I do SELECT id FROM t WHERE id > 0 LIMIT 10; it will return > 1,2,3,4,5,6,7,8,9,10 > But If I do SELECT max(id) FROM t WHERE id > 0 LIMIT 10; it will > return 99. > My logic, which may be flawed

[sqlite] max() with LIMIT

2011-08-31 Thread Tobias Vesterlund
Hi, I'm want to get the max value out of a certain column in a table. Table t has a column named id, which ranges from 0 to 99. If I do SELECT max(id) FROM t; it will return 99. If I do SELECT id FROM t WHERE id > 0 LIMIT 10; it will return 1,2,3,4,5,6,7,8,9,10 But If I do SELECT max(id) FROM

Re: [sqlite] Clarification about Triggers

2011-08-31 Thread Dan Kennedy
On 08/30/2011 10:48 PM, Black, Michael (IS) wrote: I found that if you used the default rowid it always gave -1 for the value. That's why I put in it's own key. I don't understand why this doesn't work...perhaps somebody can point out the error here...new.rowid contains -1. I would think that