Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Eric Sigler
We haven't watched the WAL continuously, but we have noticed that the WAL file grows slowly in size over time between application restarts (around every 2 weeks). Currently, the WAL file for one of our DBs is around 40MB, we've seen it grow up to 130MB or so. I'll try to catch the WAL size and

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Pavel Ivanov
> DB file in WAL mode, checkpointing done every 5 seconds by separate > thread in program Depending on the mode of checkpointing you use it can fail if there are some other reading or writing transactions in progress. And at the time you observe very long rollback actual checkpointing happens

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Simon Slavin
On 8 Jun 2011, at 2:02am, Eric Sigler wrote: > Does anyone know of a reason why we might be seeing SQLite transaction > rollbacks that take between 60 and 240 seconds? My initial thought was a faulty hard disk: bad sectors or a duff controller. Given that you're running inside a VM, it might

[sqlite] Slow rollback - possible causes?

2011-06-07 Thread Eric Sigler
Hello! Does anyone know of a reason why we might be seeing SQLite transaction rollbacks that take between 60 and 240 seconds?  (One particularly odd occurrence was almost 20 minutes long!)  This doesn't seem to happen often, but when it does it's painful.  During the rollback, the disk is

Re: [sqlite] Is it possible to optimize the readperformanceofa C++ app using sqlite pragma journal_mode = wal

2011-05-29 Thread Michael Stephenson
Subject: Re: [sqlite] Is it possible to optimize the readperformanceofa C++ app using sqlite pragma journal_mode = wal On 30 May 2011, at 2:08am, Frank Chang wrote: > Thank you for your help with the PRAGMA page size question. Sometimes I see C++ programs which first issue the PRAGMA page_s

Re: [sqlite] Is it possible to optimize the readperformanceofa C++ app using sqlite pragma journal_mode = wal

2011-05-29 Thread Simon Slavin
On 30 May 2011, at 2:08am, Frank Chang wrote: > Thank you for your help with the PRAGMA page size question. Sometimes I see > C++ programs which first issue the PRAGMA page_size = 4096. Then these C++ > programs request a sqlite3_execute(Database,"VACUUM",callback,0,) which > takes about 4

Re: [sqlite] Is it possible to optimize the readperformanceofa C++ app using sqlite pragma journal_mode = wal

2011-05-29 Thread Frank Chang
Simon Slavin, Thank you for your help with the PRAGMA page size question. Sometimes I see C++ programs which first issue the PRAGMA page_size = 4096. Then these C++ programs request a sqlite3_execute(Database,"VACUUM",callback,0,) which takes about 4 minutes to complete. We

Re: [sqlite] Is it possible to optimize the readperformanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-28 Thread Michael Stephenson
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Frank Chang Sent: Saturday, May 28, 2011 9:38 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Is it possible to optimize the readperformanceof a C++ app using sqlite pragma

Re: [sqlite] Is it possible to optimize the readperformanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-28 Thread Frank Chang
Michael Stephenson, We want to thank you again for your excellent suggestions regarding how to improve the speed of our Sqlite WAL reads and our deduper prototype. We looked at the SQlite documentation for increasing the Sqlite page size to 4K and an excerpt of our code is shown below. If we

Re: [sqlite] Is it possible to optimize the readperformanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-28 Thread Simon Slavin
On 28 May 2011, at 4:30pm, Frank Chang wrote: > We were wondering if you could tell us what sqlite C/C++ API function to use > to change the SQLIte page size to 4KB. Thank you for all of your help. Page Size is part of the setup of the database file, so the way you set it is this: Use PRAGMA

Re: [sqlite] Is it possible to optimize the readperformanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-28 Thread Frank Chang
Michael Stephenson, Thank you for all of your excellent ideas on increasing the speed of the deduper and the speed of the WAL reads, We will try these ideas. We were wondering if you could tell us what sqlite C/C++ API function to use to change the SQLIte page size to 4KB. Thank you for all

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-27 Thread Michael Stephenson
, 2011 11:06 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal Roger Binns, Thank you suggesting that we run a benchmark that tests our prototype deduper with and without WAL using different page

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal

2011-05-27 Thread Frank Chang
Roger Binns, Thank you suggesting that we run a benchmark that tests our prototype deduper with and without WAL using different page sizes and different transactions. >> You never answered the important bit - is your concern about initial >> population of the database or about runtime later

Re: [sqlite] Is it possible to optimize the read performance of a C++ app using sqlite pragma journal_mode = wal & pragma wal_checkpoint?

2011-05-27 Thread Frank Chang
Jean-Christophe Deschamps. Thank you for thoughtful reply. I will show it my boss when he return on Tuesday(Monday May 30th is Memorial Day. Thank you. Date: Fri, 27 May 2011 03:27:44 +0200 To: frank_chan...@hotmail.com From: j...@antichoc.net Subject: Re: [sqlite] Is it possible to optimize

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal & pragma

2011-05-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/26/2011 10:41 PM, Frank Chang wrote: > > Roger Binns, Thank you for your reply. You never answered the important bit - is your concern about initial population of the database or about runtime later on. > Would you expect us to get

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal & pragma

2011-05-26 Thread Frank Chang
Roger Binns, Thank you for your reply. I understand what you are saying that we should drop the sqlite3_wal_checkpoint_v2(Database,"main",SQLITE_CHECKPOINT_FULL, // ,); after the commit transaction ReturnValue=sqlite3_prepare(Database,"COMMIT",-1,,0); status = sqlite3_step(Statement);

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal & pragmawal_checkpoint?

2011-05-26 Thread Jean-Christophe Deschamps
We would still like to know your experience with SQLite > WAL databases compared to SQlite non-WAL databases. Particularly, we > are in the sqlite read processing in SQLIte WAL databases. Is > possible to SQLiTe WAL databases to have faster read processing than > SQLite non

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal & pragmawal_checkpoint?

2011-05-26 Thread Simon Slavin
qlite read processing in SQLIte WAL databases. Is possible to SQLiTe WAL > databases to have faster read processing than SQLite non-WAL databases. If > so, what method to use to gain the read improvement I hope that other people will answer this. However since speed is important to you,

Re: [sqlite] Is it possible to optimize the read performanceof a C++ app using sqlite pragma journal_mode = wal & pragmawal_checkpoint?

2011-05-26 Thread Frank Chang
like to know your experience with SQLite WAL databases compared to SQlite non-WAL databases. Particularly, we are in the sqlite read processing in SQLIte WAL databases. Is possible to SQLiTe WAL databases to have faster read processing than SQLite non-WAL databases. If so, what method to use

Re: [sqlite] Is it possible to optimize the read performance of a C++ app using sqlite pragma journal_mode = wal & pragma wal_checkpoint?

2011-05-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/25/2011 07:04 PM, Frank Chang wrote: > While writing the records to to the sqlite database we do a commit every > 1 records. >We think we understand that we also need to do a sqlite pragma wal_checkpoint everytime >we do a sqlite database

Re: [sqlite] Is it possible to optimize the read performance of a C++ app using sqlite pragma journal_mode = wal & pragma wal_checkpoint?

2011-05-25 Thread Simon Slavin
On 26 May 2011, at 3:04am, Frank Chang wrote: > In the second phase, we read the sqlite WAL database and try to find > out the duplicates in our input records. Here, we are only reading the sqlite > WAL database. We would like to find out how to optimize the read performance > of the

[sqlite] Is it possible to optimize the read performance of a C++ app using sqlite pragma journal_mode = wal & pragma wal_checkpoint?

2011-05-25 Thread Frank Chang
Good evening, We are trying to build a C++ deduper application using the latest sqlite release. Our deduper runs in two phases. In the first phase it reads the records to be deduped from a Microsoft DBF file and writes the records into sqlite wal database. While writing the records to to the

Re: [sqlite] Is it possible to determine how many openconnections are active for a sqlite database?

2011-02-20 Thread Black, Michael (IS)
-boun...@sqlite.org] on behalf of Frank Chang [frank_chan...@hotmail.com] Sent: Saturday, February 19, 2011 11:25 PM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Is it possible to determine how many openconnections are active for a sqlite database? I wanted to thank Roger Binns

Re: [sqlite] Is it possible to determine how many openconnections are active for a sqlite database?

2011-02-19 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/19/2011 09:25 PM, Frank Chang wrote: > >I wanted to thank Roger Binns for solving my problem. You are welcome :-) > I was able to determine the sqlite database was corrupted Just to be clear for people finding this thread in the

Re: [sqlite] Is it possible to determine how many openconnections are active for a sqlite database?

2011-02-19 Thread Frank Chang
I wanted to thank Roger Binns for solving my problem. Using sqlite3_request, I was able to determine the sqlite database was corrupted when I didn't issue a BEGIN EXCLUSIVE before beginning to insert the 5.4 million rows. Evidently, the use of BEGIN EXCLUSIVE prevents my transaction from

Re: [sqlite] iIs it possible to determine how many open connections are active for a sqlite database?

2011-02-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/18/2011 07:24 PM, Frank Chang wrote: > As a result, I periodically get a sqlite return code of 1 from sqlite3_step > after inserting one of the 5.4 million rows. That just means there was an error. You still need to sqlite3_reset to find out

Re: [sqlite] iIs it possible to determine how many open connections are active for a sqlite database?

2011-02-18 Thread Frank Chang
I did some research into this topic . I read the following sqlite-users posts http://www.mail-archive.com/sqlite-users@sqlite.org/msg25752.html and http://www.mail-archive.com/sqlite-users@sqlite.org/msg25762.html . From these posts, its says as of 2007, there is no sqlite public api for

[sqlite] iIs it possible to determine how many open connections are active for a sqlite database?

2011-02-18 Thread Frank Chang
Good evening, I am trying to insert 5.4 million rows to a sqlite database running in Windows or Unix/Linux. I am using a transaction to try to speed up the insertions. When the sqlite database is accessed by multiple connections, and one of the processes modifies the database, the

Re: [sqlite] Is it possible to update the same sqlite table using two different Linux pthread threads?

2010-12-16 Thread Richard Hipp
On Thu, Dec 16, 2010 at 9:19 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Frank Chang <frankchan...@gmail.com> wrote: > > Good morning, If we use the latest version of sqlite, is it possible to > > update the same sqlite table using two different Centos/RedHat

Re: [sqlite] Is it possible to update the same sqlite table using two different Linux pthread threads?

2010-12-16 Thread Igor Tandetnik
Frank Chang <frankchan...@gmail.com> wrote: > Good morning, If we use the latest version of sqlite, is it possible to > update the same sqlite table using two different Centos/RedHat Linux pthread > threads? Yes, but not at the same time. > We are using the same database

[sqlite] Is it possible to update the same sqlite table using two different Linux pthread threads?

2010-12-16 Thread Frank Chang
Good morning, If we use the latest version of sqlite, is it possible to update the same sqlite table using two different Centos/RedHat Linux pthread threads? We are using the same database connection on both pthreads but we always update different rows on each of the two threads. We have run

Re: [sqlite] Is it possible to generate tf-idf matrix from the FTS3 table?

2010-06-08 Thread Scott Hess
On Sat, Jun 5, 2010 at 10:29 AM, Han-Teng Liao wrote: >    I intend to use my existing datasets stored in sqlite3 database for some > linguistic analysis for Chinese language. After I have successfully > installed and run the FTS3 Extension and ICU Extension, I am curious

[sqlite] Is it possible to generate tf-idf matrix from the FTS3 table?

2010-06-06 Thread Han-Teng Liao
Hello, sqlite users, I intend to use my existing datasets stored in sqlite3 database for some linguistic analysis for Chinese language. After I have successfully installed and run the FTS3 Extension and ICU Extension, I am curious whether it is theoretically possible to generate the tf-idf

Re: [sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-02 Thread Dan Kennedy
On Jun 2, 2010, at 7:19 PM, Simon Slavin wrote: > > On 2 Jun 2010, at 10:12am, Dan Kennedy wrote: > >> The fix you propose would ignore the (suspected) corruption >> and continue without reporting it to the user. Which might be >> the best thing for some > > but not for me. Please do not roll

Re: [sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-02 Thread Simon Slavin
On 2 Jun 2010, at 10:12am, Dan Kennedy wrote: > The fix you propose would ignore the (suspected) corruption > and continue without reporting it to the user. Which might be > the best thing for some but not for me. Please do not roll anything like that into the source. I definitely want error

Re: [sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-02 Thread Dan Kennedy
On Jun 1, 2010, at 10:21 AM, Peter Kolbus wrote: > I am getting an access violation in rtree.c::nodeGetRowid() using a > database image of questionable integrity (the application the database > was last updated on shut down abnormally, but executing PRAGMA > integrity_check returns "ok" and

[sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-01 Thread Peter Kolbus
I am getting an access violation in rtree.c::nodeGetRowid() using a database image of questionable integrity (the application the database was last updated on shut down abnormally, but executing PRAGMA integrity_check returns "ok" and there is no journal file). The access violation can be

Re: [sqlite] is it possible to query for database file name ?

2010-05-05 Thread Simon Slavin
On 5 May 2010, at 11:08am, yogibabu wrote: > in php I declared database object: > $pdo = new PDO('sqlite:mybase.DB3'); > > i know how to get information about engine used in this connection, which > is: > $pdo->getAttribute(PDO::ATTR_DRIVER_NAME); ---> string 'sqlite' > > But I do not know

Re: [sqlite] is it possible to query for database file name ?

2010-05-05 Thread Kees Nuyt
On Wed, 5 May 2010 03:08:42 -0700 (PDT), yogibabu wrote: > >in php I declared database object: >$pdo = new PDO('sqlite:mybase.DB3'); > >i know how to get information about engine used in this connection, which >is: >$pdo->getAttribute(PDO::ATTR_DRIVER_NAME); ---> string

Re: [sqlite] is it possible to query for database file name ?

2010-05-05 Thread Simon Davies
On 5 May 2010 11:08, yogibabu wrote: > > in php I declared database object: > $pdo = new PDO('sqlite:mybase.DB3'); > > i know how to get information about engine used in this connection, which > is: > $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);   ---> string 'sqlite' > > But I

[sqlite] is it possible to query for database file name ?

2010-05-05 Thread yogibabu
in php I declared database object: $pdo = new PDO('sqlite:mybase.DB3'); i know how to get information about engine used in this connection, which is: $pdo->getAttribute(PDO::ATTR_DRIVER_NAME); ---> string 'sqlite' But I do not know how to get back the actual database file name back from this

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread yogibabu
P Kishor-3 wrote: > what is the name of the column? Is it '--idcolumn--'? That was only example written when I didn't know even for what syntax to look for. Now problem comes to how to run SELECT against PRAGMA table_info(tblname). Only way out of this that I found is to run regex against the

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread P Kishor
On Mon, May 3, 2010 at 2:14 AM, yogibabu wrote: > > like this: SELECT --idcolumn-- FROM `table` what is the name of the column? Is it '--idcolumn--'? Are the leading and trailing '--' part of the name? Remember that leading '--' is used as SQL comments. If that is indeed

Re: [sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread Simon Slavin
On 3 May 2010, at 8:14am, yogibabu wrote: > like this: SELECT --idcolumn-- FROM `table` If you always want to use a unique integer to refer to a record, you can ask for the column called '_rowid_' even if you didn't define one. You can use this in SELECT and UPDATE commands, as long as you

[sqlite] is it possible to return primary key column from given table ?

2010-05-03 Thread yogibabu
like this: SELECT --idcolumn-- FROM `table` -- View this message in context: http://old.nabble.com/is-it-possible-to-return-primary-key-column-from-given-table---tp28432175p28432175.html Sent from the SQLite mailing list archive at Nabble.com. ___

Re: [sqlite] Is it possible for SQLite to notify anapplicationconnected to it of database changes?

2009-11-24 Thread Simon Slavin
On 24 Nov 2009, at 6:17pm, Erin Drummond wrote: >> What, precisely, do you poll ? > A few mutually exclusive tables in the database to check for changes. Depending on what you care about, you might find it easier to check PRAGMA count_changes either instead of what you currently poll, or as

Re: [sqlite] Is it possible for SQLite to notify anapplicationconnected to it of database changes?

2009-11-24 Thread Erin Drummond
> if your application is the one making changes, can't it just notify itself at > the same time? Actually, come to think of it, it probably could. *facepalms self*. The application is going to expose a web interface which the user interacts with (this is how the database gets changed in the first

Re: [sqlite] Is it possible for SQLite to notify an application connected to it of database changes?

2009-11-24 Thread Simon Slavin
On 24 Nov 2009, at 4:12am, Erin Drummond wrote: > Currently it finds changes by constantly polling the database What, precisely, do you poll ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Is it possible for SQLite to notify anapplicationconnected to it of database changes?

2009-11-24 Thread Igor Tandetnik
Erin Drummond wrote: > @Igor: I think you misunderstood. I only have one connection to the > database (provided by the JDBC driver). I only care about and use that > one connection (no other applications access the database). I was > wondering if database trigger could be used to notify the

Re: [sqlite] Is it possible for SQLite to notify an applicationconnected to it of database changes?

2009-11-23 Thread Erin Drummond
Ok, thankyou for your replies @Igor: I think you misunderstood. I only have one connection to the database (provided by the JDBC driver). I only care about and use that one connection (no other applications access the database). I was wondering if database trigger could be used to notify the

Re: [sqlite] Is it possible for SQLite to notify an applicationconnected to it of database changes?

2009-11-23 Thread Igor Tandetnik
Erin Drummond wrote: > I am developing a p2p application (in Java) which has a SQLite > database attached. I am currently using the sqlitejdbc JDBC driver for > database access. > Ideally, I want SQLite to notify the application whenever a change is > made in the database, so

Re: [sqlite] Is it possible for SQLite to notify an application connected to it of database changes?

2009-11-23 Thread J. King
On Mon, 23 Nov 2009 23:12:12 -0500, Erin Drummond wrote: > Is it possible for an application to be notified when a trigger inside > the database is fired? I imagine you could make the trigger call a user function which notifies the application... -- J. King

[sqlite] Is it possible for SQLite to notify an application connected to it of database changes?

2009-11-23 Thread Erin Drummond
Hi, I am developing a p2p application (in Java) which has a SQLite database attached. I am currently using the sqlitejdbc JDBC driver for database access. Ideally, I want SQLite to notify the application whenever a change is made in the database, so it can propagate the change to other peers.

Re: [sqlite] Is it possible to combine a collation and a search

2009-10-14 Thread Jean-Christophe Deschamps
Andy, >Hwever, what I want to do is seach for all of these varients too, i.e. so >that if I search for e that I get all of the e and accented e' etc, is >this >possble using something like the collation, or do I need to specify all of >them individually? I'm about to release the beta of an

[sqlite] less typing possible ?

2009-09-27 Thread Stef Mientki
hello, I often want to see most of the columns of a table / view / query, but a few I don't want to see. So I now create a huge list of fields, but isn't there a more typo-frindly way, like : select * - field33 from table thanks, Stef Mientki ___

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>"Simple" is relative - as you write yourself - your App #>already performs faster using SQL for the right things - and #>that don't have to be only "simple queries" - what you #>already do with all these nice Group By queries - directly #>delivering weekly or monthly stock-data, derived from

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Simon Slavin
On 11 Jul 2009, at 2:39am, Rick Ratchford wrote: > When I read Simon's reply, I did not get the sense that he was > suggesting I > do a Rs-Loop. It appeared to me, and I could be mistaken of course, > that he > was referring to pure programming in by language (VB). The people on this list

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Olaf Schmidt
"Rick Ratchford" schrieb im Newsbeitrag news:152a3111f1ab4a9891b9158580cb7...@dolphin... > Maybe I misunderstood, but the impression I got was > that I should solve this problem using my VB language > rather than dealing with the DB. I don't understand Simons reply

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Virgilio Alexandre Fornazin
: sexta-feira, 10 de julho de 2009 23:10 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Is it Possible in SQL... #>I was trying to figuring out if you are doing something of #>graph data analysis, I do it almost everyday in our Stock #>Trader applications... #>

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>I was trying to figuring out if you are doing something of #>graph data analysis, I do it almost everyday in our Stock #>Trader applications... #>I never did this way (direct SQL), cause our graph series #>data sources are implement throught a common interface, that #>could be a SQL query, a

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>"Rick Ratchford" schrieb im #>Newsbeitrag news:c9ce387e92004e7b9c16ddaa2bd36...@dolphin... #> #>> So modifying TmpTable, which will still be needed for other #>> procedures, is not preferred. It would be great if a #>recordset could #>> be derived from it instead

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Virgilio Alexandre Fornazin
Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rick Ratchford Sent: sexta-feira, 10 de julho de 2009 17:32 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Is it Possible in SQL... Seems there was a question in your reply I

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Olaf Schmidt
"Rick Ratchford" schrieb im Newsbeitrag news:c9ce387e92004e7b9c16ddaa2bd36...@dolphin... > So modifying TmpTable, which will still be needed for > other procedures, is not preferred. It would be great if > a recordset could be derived from it instead that contains >

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>-Original Message- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin #>Sent: Friday, July 10, 2009 7:41 PM #>To: General Discussion of SQLite Database #>Subject: Re: [sqlite] Is it Possible in SQL... #> #> #>

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Simon Slavin
On 10 Jul 2009, at 11:36pm, Rick Ratchford wrote: > I understand what you're saying Simon. Sorry, Rick. I didn't mean to rail on you personally. Your post happened to be the one that triggered me to post the rant. I understand your reasoning and don't think you personally have done

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Jay A. Kreibich
On Fri, Jul 10, 2009 at 10:15:03PM +0100, Simon Slavin scratched on the wall: > > I don't understand why people keep trying to do these things inside > SQL when they're obviously ysing a programming language anyway. Why wouldn't you? The data is in a database. SQL is how you manipulate

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#> #>This will create another table TmpTable (tax, direction), #>using the values from the table MarketTable: #> #>create table TmpTable as #>select tax, #>(select #> case when b.tax < MarketTable .tax #> then "Up" #> when b.tax>=MarketTable .tax #> then "Down" #> else null #> end #>

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>On 10 Jul 2009, at 9:31pm, Rick Ratchford wrote: #> #>> After examining the above, it appears that what this does is modify #>> the table itself. So I suppose then that it is not possible #>to create #>> a recordset instead that meets what I'm trying to do. If #>this is the #>> case, I'll

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Simon Slavin
On 10 Jul 2009, at 9:31pm, Rick Ratchford wrote: > After examining the above, it appears that what this does is modify > the > table itself. So I suppose then that it is not possible to create a > recordset instead that meets what I'm trying to do. If this is the > case, > I'll have to make

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Wes Freeman
This will create another table TmpTable (tax, direction), using the values from the table MarketTable: create table TmpTable as select tax, (select case when b.tax < MarketTable .tax then "Up" when b.tax>=MarketTable .tax then "Down" else null end from MarketTable b where

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
Seems there was a question in your reply I didn't catch the first time. > #>What do you mean by "previous one"? Records in a table don't #>have any implicit ordering. Do you have some kind of a #>timestamp field that imposes the order? The table, each time, has been in order from oldest Date

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Wes Freeman
If you want to use the rowid to order the rows (or an auto-incrementing primary key field), you could do something like this: update tst set Direction= (select case when b.tax < tst.tax then "Up" when b.tax>=tst.tax then "Down" else null end from tst b where b.rowid=tst.rowid-1)

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
#>-Original Message- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik #>Sent: Friday, July 10, 2009 2:50 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sqlite] Is it Possible in SQL... #>

Re: [sqlite] Is it Possible in SQL...

2009-07-10 Thread Igor Tandetnik
Rick Ratchford wrote: > Is it possible, using SQL, to do comparisions across records? > > Suppose that you had 1 field called TAX and you wanted to compare > each one to the previous one. What do you mean by "previous one"? Records in a table don't have any implicit

[sqlite] Is it Possible in SQL...

2009-07-10 Thread Rick Ratchford
Is it possible, using SQL, to do comparisions across records? Suppose that you had 1 field called TAX and you wanted to compare each one to the previous one. Record 1 = TAX (45) Record 2 = TAX (65) Record 3 = TAX (22) So using the data above, I would want to compare Record 2 (65) to Record 1

Re: [sqlite] Is this possible?

2009-03-01 Thread P Kishor
On Sun, Mar 1, 2009 at 4:43 PM, Mike Yenco wrote: > > On Mar 1, 2009, at 5:18 PM, P Kishor wrote: > >> It is going to get even more complicated and soon approach Igor-level >> of complexity. So, for sanity's sake, it would probably be done better >> in your application. > > Thanks

Re: [sqlite] Is this possible?

2009-03-01 Thread Mike Yenco
On Mar 1, 2009, at 5:18 PM, P Kishor wrote: > It is going to get even more complicated and soon approach Igor-level > of complexity. So, for sanity's sake, it would probably be done better > in your application. Thanks for the explanation. Yeah, as I said in one of my previous emails, my first

Re: [sqlite] Is this possible?

2009-03-01 Thread P Kishor
On Sun, Mar 1, 2009 at 4:04 PM, Mike Yenco wrote: > > On Mar 1, 2009, at 2:15 PM, Martin Engelschalk wrote: > >> Hi Mike, >> >> Yes, this is possible, however, it is complicated. > > Hi Martin, > > Thanks for the reply.  It usually is complicated :-) > > >> select Name, case

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
Hi Mike, Yes, this is possible, however, it is complicated. Lets first create the tables an populate them: create table Container (ContainerName text, ContainerId text primary key) create table Contents (ContentName text, ContainerId text) insert into Container values ('Fruit', 'ABC-0001');

Re: [sqlite] Is this possible?

2009-03-01 Thread Mike Yenco
OK, let's see if I can clarify this. I'm using "blank", "Group", and "Code" as placeholders here. Blank is a column that contains nothing (An empty placeholder I need for display purposes). Group could be any text. Code is some ID text. Table B is being written to by some third-party code

Re: [sqlite] Is this possible?

2009-03-01 Thread P Kishor
On Sun, Mar 1, 2009 at 11:14 AM, Mike Yenco wrote: > Ok, I guess this list doesn't support image attachments.  Let's see if > I can sort of illustrate what I'm looking to do in text without > requiring 1000 words. > > Table A > blank | Group 1 | Code 1 > blank | Group 2 | Code 2 >

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
Hi Mike, sorry, i don't fully get it. However, a single SQL statement can not return data rows of different structure as you indicated in your example. Especially, I am confused about "blank". It seems to come from Table A, same as "Group *". Do you want to put "Group *" as a sort of headline,

Re: [sqlite] Is this possible?

2009-03-01 Thread Mike Yenco
Ok, I guess this list doesn't support image attachments. Let's see if I can sort of illustrate what I'm looking to do in text without requiring 1000 words. Table A blank | Group 1 | Code 1 blank | Group 2 | Code 2 blank | Group 3 | Code 3 Table B Item 1 | Code 1 Item 2 | Code 1 Item 3 |

Re: [sqlite] Is this possible?

2009-03-01 Thread Martin Engelschalk
Hi Mike, you can't use attachments in this mailing list. Best post your data model, some data and the desired result. Martin Mike Yenco wrote: > Is there a way that SQLite can return all matching items to a search > string in Table B, but return a group name from Table A before each > set of

[sqlite] Is this possible?

2009-03-01 Thread Mike Yenco
Is there a way that SQLite can return all matching items to a search string in Table B, but return a group name from Table A before each set of matching items within the result? (see attached image). ___ sqlite-users mailing list

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-05 Thread Luis Esteban Fajardo Bravo
Of course it's possible, it's almost exactly as your pseudo-sql Greetings! Dennis Volodomanov escribió: > Hello all, > > > > I'm not sure if it's possible to do this using only SQL, so I'd like to > ask: > > > > I need to add a column to a table which will be populated with data from >

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Dennis Volodomanov
-Original Message- From: Dennis Volodomanov Sent: Tuesday, February 05, 2008 11:28 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Is it possible to do this using only SQL? I'll try taking out the ANALYZE and VACUUM and see if it helps. I'm using transactions and I am creating

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Dennis Volodomanov
, 2008 11:17 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Is it possible to do this using only SQL? On 2/4/08, Dennis Volodomanov <[EMAIL PROTECTED]> wrote: > Hmm, strange - my testing produces very slow results (it took over a > minute to update 120K rows). well, for one, yo

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Dennis Volodomanov
? (The database is around 900 MBs) Dennis -Original Message- From: P Kishor [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 11:04 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Is it possible to do this using only SQL? On 2/4/08, Dennis Volodomanov <[EM

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread P Kishor
using transactions, no? What! No! Why "no"? Go use transactions. > >Dennis > > > -Original Message- > From: P Kishor [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 05, 2008 11:04 AM > To: General Discussion of SQLite Database > Subject: Re: [sqli

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread P Kishor
On 2/4/08, Dennis Volodomanov <[EMAIL PROTECTED]> wrote: > Oh, that looks simpler than I thought. Thank you for the reply! not only is it simple... ... > > On 04-Feb-2008, at 3:41 PM, Dennis Volodomanov wrote: > > > Is that possible? If not, I'll have to do it in the code, but that > > will > >

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Dennis Volodomanov
Oh, that looks simpler than I thought. Thank you for the reply! Dennis -Original Message- From: Steven Fisher [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 10:50 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Is it possible to do this using only SQL

Re: [sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Steven Fisher
On 04-Feb-2008, at 3:41 PM, Dennis Volodomanov wrote: > Is that possible? If not, I'll have to do it in the code, but that > will > probably be slower and I'm expecting to have tens of thousands of > rows. Sure: sqlite> create table x(a); sqlite> insert into x(a) values('ABC'); sqlite>

[sqlite] Is it possible to do this using only SQL?

2008-02-04 Thread Dennis Volodomanov
Hello all, I'm not sure if it's possible to do this using only SQL, so I'd like to ask: I need to add a column to a table which will be populated with data from another column in that table, but converted to lower-case. So, in pseudo-code I need to do this: ALTER TABLE MyTable ADD

[sqlite] Tcl: "sharing a variable" using SQLite - could be possible?

2007-12-30 Thread Zbigniew Baniewski
Reading the paper http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html - especially the paragraph "SQLite Extensions Written In Tcl" - I was wondering, if could be possible to arrange something like this: Suppose, we have one SQLite database with several connections from different

Re: [sqlite] Failed subquery (possible bug?)

2007-04-11 Thread Dennis Cote
Steve Krulewitz wrote: Hey all, On sqlite 3.3.12, I see the following: create table test_in (data text, ordinal text); insert into test_in values ('foo', '0'); insert into test_in values ('bar', '1'); insert into test_in values ('baz', '2'); Running: select count(1) from test_in where

[sqlite] Failed subquery (possible bug?)

2007-04-11 Thread Steve Krulewitz
Hey all, On sqlite 3.3.12, I see the following: create table test_in (data text, ordinal text); insert into test_in values ('foo', '0'); insert into test_in values ('bar', '1'); insert into test_in values ('baz', '2'); Running: select count(1) from test_in where ordinal in (select ordinal

Re: [sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-16 Thread drh
Kevin Stewart <[EMAIL PROTECTED]> wrote: > I am still curious. Generally speaking, can one access > the database inside the callback from select via sqlite_exec()? > Yes. SQLite is reentrant. SQLite uses this reentrancy internally. There are occasions when you are running an SQL statement

Re: [sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-16 Thread Jay Sprenkle
On 9/15/06, Kevin Stewart <[EMAIL PROTECTED]> wrote: Well, its a little more complicated than that. I don't want the whole table, just the set of records that matched the initial search criteria in the select. But thanks for your response. I did a little redesigning Add a where clause to the

Re: [sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-15 Thread Kevin Stewart
Well, its a little more complicated than that. I don't want the whole table, just the set of records that matched the initial search criteria in the select. But thanks for your response. I did a little redesigning of the database schema and the way my code handles things and I came up with a

<    1   2   3   4   5   >