Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Bill Webster
My use case is long-lived C++ application, which invokes millions of worker threads during its lifetime. My C++ objects do "clean up after themselves", but I would like to provide strong guarantees about memory and file handles in exception handlers. Performance is very important. I can't just sp

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/26/2010 09:48 PM, Bill Webster wrote: > Closing file handles and statement handles is not particularly drastic. Not > to be encouraged obviously, but no worse than sudden termination of the > program or power-off. What is it exactly that leads y

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/26/2010 07:47 PM, Bill Webster wrote: > I meant something that released all open files, blob handles, statement > handles etc., without terminating the process. > > I guess that this must've been considered and that there is a practical or > phi

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Bill Webster
Closing file handles and statement handles is not particularly drastic. Not to be encouraged obviously, but no worse than sudden termination of the program or power-off. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tan

Re: [sqlite] How to use load_extension()?

2010-06-26 Thread Igor Tandetnik
Sam Carleton wrote: > I have created a little extension function that I would like to load into my > Qt program, so I am using the function load_extension, but it always returns > false. http://sqlite.org/c3ref/enable_load_extension.html -- Igor Tandetnik __

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Igor Tandetnik
Bill Webster wrote: > Sorry for not being clear enough. > > I meant something that released all open files, blob handles, statement > handles etc., without terminating the process. > > I guess that this must've been considered and that there is a practical or > philosophical objection to it. If

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Bill Webster
Sorry for not being clear enough. I meant something that released all open files, blob handles, statement handles etc., without terminating the process. I guess that this must've been considered and that there is a practical or philosophical objection to it. -Original Message- From: sql

Re: [sqlite] sqlite3_abort()?

2010-06-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/26/2010 07:29 PM, Bill Webster wrote: > Excuse me as an extreme newbie, but it would seem useful to have a method > that is guaranteed to release all resources. > > Perhaps it exists and I just didn't see it? It does indeed and is provided by y

[sqlite] sqlite3_abort()?

2010-06-26 Thread Bill Webster
Excuse me as an extreme newbie, but it would seem useful to have a method that is guaranteed to release all resources. Perhaps it exists and I just didn't see it? Bill Webster Year0 Software that works. b...@year0.com.au ___ sqlite-users ma

Re: [sqlite] (python) how to define unchangeable global ID in a table?

2010-06-26 Thread Simon Slavin
On 26 Jun 2010, at 4:34pm, kee wrote: > both of them may have duplicated records ... and later ... >name TEXT NOT NULL UNIQUE, Those two things contradict each-other. If you specify UNIQUE you can't have duplicated values. > CREATE TABLE tableA { Try to get out of that habit. if thos

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Max Vlasov
On Sat, Jun 26, 2010 at 7:27 AM, zhangzhenggui wrote: > tbl_test maybe like this: > create table tbl_test(f1, f2, f3); > > Now, I want to get the num of records which (f1, f2) are distinct. > > I try "select count(distinct f1, f2) from tbl_test", but error occur: SQL > error: wrong number of argum

[sqlite] How to use load_extension()?

2010-06-26 Thread Sam Carleton
I have created a little extension function that I would like to load into my Qt program, so I am using the function load_extension, but it always returns false. I am currently hard coding the path: QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(systemDB); Q

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Roger Andersson
> >> Now, I want to get the num of records which (f1, f2) are distinct. > >> > > Maybe something like > > SELECT f1,f2,count(*) FROM tbl_test GROUP BY f1,f2; > > That would return, for each (f1, f2) bucket, the number of > records that fall into this bucket. That doesn't sound like > what the O

[sqlite] (python) how to define unchangeable global ID in a table?

2010-06-26 Thread kee
Dear all I have 2 string lists, listA and listB as raw data which need to be store in the SQLITE database, both of them may have duplicated records listA listB === orangejapan pear

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Igor Tandetnik
Roger Andersson wrote: >> Ämne: [sqlite] Why "select count(distinct f1, f2) from >> tbl_test" can not work? >> >> Now, I want to get the num of records which (f1, f2) are distinct. >> > Maybe something like > SELECT f1,f2,count(*) FROM tbl_test GROUP BY f1,f2; That would return, for each (f1, f2

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Igor Tandetnik
zhangzhenggui wrote: > Now, I want to get the num of records which (f1, f2) are distinct. > > although, I can do like this, but I think it not very good : > select count(1) from (select distinct f1, f2 from tbl_test); What makes you think it's "not very good"? What do you feel is the problem wit

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Roger Andersson
> Ämne: [sqlite] Why "select count(distinct f1, f2) from > tbl_test" can not work? > > tbl_test maybe like this: > create table tbl_test(f1, f2, f3); > > Now, I want to get the num of records which (f1, f2) are distinct. > > I try "select count(distinct f1, f2) from tbl_test", but > error occu

Re: [sqlite] normalization example(s)

2010-06-26 Thread Simon Slavin
On 26 Jun 2010, at 6:36am, John wrote: > On 6/25/2010 10:51 PM, Simon Slavin wrote: >> >> On 26 Jun 2010, at 3:47am, John wrote: >> >>> I don't know if SQLite now supports foreign keys yet or not. >> >> So you're posting to a mailing list you don't read ? > > I read this! ;-) Oh. Okay, well

Re: [sqlite] normalization example(s)

2010-06-26 Thread Jay A. Kreibich
On Sat, Jun 26, 2010 at 03:51:12AM +0100, Simon Slavin scratched on the wall: > So you're posting to a mailing list you don't read ? People replay without seeming to read all the time... -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important

[sqlite] Why "select count(distinct f1, f2) fro m tbl_test" can not work?

2010-06-26 Thread zhangzhenggui
tbl_test maybe like this: create table tbl_test(f1, f2, f3); Now, I want to get the num of records which (f1, f2) are distinct. I try "select count(distinct f1, f2) from tbl_test", but error occur: SQL error: wrong number of arguments to function count() although, I can do like this, but I thi