Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Jan Berger
Actually it does set C++ by default - look under Properties C/C++ Advanced - you have "Compile As" VC 2008 and 2010 set this to Yes by default. Jan -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Teg Sent: 8. mai 2011 23:48

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
The reason to delay connection trigger firing to the first non-pragma statement would be to allow one to enable or disable db triggers. DB triggers should also be disabled by default, and ahould have a separate set of pragmas to enable or disable them. The main utility of connect triggers is to

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
As for attached DBs, each DB gets its own db triggers. DB connect trigger firing should be about the same (first non-pragma statement affecting the attached db). ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
On May 8, 2011 4:14 PM, "Roger Binns" wrote: > C) What about SAVEPOINT? Sounds useful... I should add that too. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
Indeed, I have been thinking about when database connect fires. My current thought is: on the first non-pragma statement executed (not prepared), not at db open time. I only care about commit, really, but if I can I'll do the others too. ___

Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Teg
Hello Jay, I haven't found this to be the case. I have numerous C only library's I compile and I don't have to change the defaults to compile them. There is an option to force C++ compiles but, I don't believe it's on by default. JAK> In most default setups, Visual Studio insists on compiling

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/08/2011 01:46 PM, Simon Slavin wrote: > Just asking to warn you it's tricky ... > > A) When do you consider that a transaction starts ? > B) How do you deal with ATTACHed databases ? C) What about SAVEPOINT? Roger -BEGIN PGP

[sqlite] Transaction speed too slow?

2011-05-08 Thread Nick
>From http://www.sqlite.org/faq.html#q19 it says "A transaction normally >requires two complete rotations of the disk platter, which on a 7200RPM disk >drive limits you to about 60 transactions per second." Using Linux/Ubuntu 10.04 on an otherwise idle Atom powered Nettop with a 5400RPM disk

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Simon Slavin
On 8 May 2011, at 9:42pm, Nico Williams wrote: > CREATE TRIGGER ON BEGIN ... END; > > where is one of DATABASE CONNECT, DATABASE DISCONNECT, > TRANSACTION START, TRANSACTION COMMIT, and TRANSACTION ROLLBACK. Just asking to warn you it's tricky ... A) When do you consider that a transaction

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
FWIW, I have parsing, automatic creation of the crutch views, and creation of the DB triggers working. Next up: firing of DB triggers. The changes so far are fairly trivial, adding very few branches, which means that writing tests for them should be relatively simple too. That said, it's taken

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Woody
what language are you using?    usually there is a property for the resultset object that will supply the number of columns in the result set and another property that will return the number of rows.  using the number of columns allows you to index into the columns in a loop retrieving each

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Jean-Christophe Deschamps
>I happen to have a code path such that the select statement can return >1, 3 >or 5 columns. I know I could go based on count, but if I could do it by >name that would be safer. I had not considered the point that multiple >columns could have the same name, though, so I fully understand why

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On Sun, May 8, 2011 at 3:08 PM, Simon Slavin wrote: > > Out of interest, are you trying to analyse the results of a "SELECT *" ? > Because since it's your query in the first place, you should know what > columns you asked for. > Nope, I NEVER do SELECT *, very, very

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Igor Tandetnik
Sam Carleton wrote: > On May 8, 2011, at 12:53 PM, "Igor Tandetnik" wrote: > >> Sam Carleton wrote: >>> I had it wrong in the email body, I meant how many columns are in query? >> >> sqlite3_column_count. Don't even need to

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Simon Slavin
On 8 May 2011, at 8:04pm, Igor Tandetnik wrote: > Sam Carleton wrote: >> I want to go the other way: I have the string name, I need the index of the >> column, same concept as >> sqlite3_bind_parameter_index(). > > You'll have to enumerate all columns, get the name of

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Igor Tandetnik
Sam Carleton wrote: > On May 8, 2011, at 11:06 AM, "Jay A. Kreibich" wrote: > >> On Sun, May 08, 2011 at 11:00:29AM -0400, Sam Carleton scratched on the wall: >> >>> Is there a way to find out the id of a particular column? >> >> sqlite3_column_name() >

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 11:06 AM, "Jay A. Kreibich" wrote: > On Sun, May 08, 2011 at 11:00:29AM -0400, Sam Carleton scratched on the wall: > >> Is there a way to find out the id of a particular column? > > sqlite3_column_name() I want to go the other way: I have the string name, I

Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Jay A. Kreibich
On Sun, May 08, 2011 at 12:50:31PM +0200, Jan Berger scratched on the wall: > I am new to sqlite3 and just downloaded the code trying to test it from a > C++ application using Visual Studio 2010. I just created a class and > included the sqlite3.c and sqlite3.h from amalgamation-3070602 directly.

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Jay A. Kreibich
On Sun, May 08, 2011 at 11:00:29AM -0400, Sam Carleton scratched on the wall: > How does one go about finding out how many rows a query returns? sqlite3_column_count() > Is there a way to find out the id of a particular column? sqlite3_column_name() -j -- Jay A. Kreibich < J A Y @

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 12:53 PM, "Igor Tandetnik" wrote: > Sam Carleton wrote: >> I had it wrong in the email body, I meant how many columns are in query? > > sqlite3_column_count. Don't even need to execute the query for that, just > prepare it. Ah,

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Kees Nuyt
On Sun, 08 May 2011 17:27:22 +0200, Thomas Mittelstaedt wrote: >Am Sonntag, den 08.05.2011, 10:08 -0400 schrieb Samuel Adam: >> On Sun, 08 May 2011 09:36:43 -0400, Jean-Christophe Deschamps >> wrote: >> >> > Change that into: >> > >> > select

Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Jan Berger
Thanks I finally managed to compile it. My challenge was that I am using a C++ project with default setting which uses C++ compiler setting, but to allow old C features you need to set the /TC option on the VC compiler - otherwise the typecasts are treated as errors etc. Jan -Original

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Igor Tandetnik
Sam Carleton wrote: > I had it wrong in the email body, I meant how many columns are in query? sqlite3_column_count. Don't even need to execute the query for that, just prepare it. -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Mr. Puneet Kishor
On May 8, 2011, at 11:46 AM, Sam Carleton wrote: > On May 8, 2011, at 11:09 AM, Jean-Christophe Deschamps > wrote: > >> >>> How does one go about finding out how many rows a query returns? >> >> This is the number of time sqlite3_step can be called successfully >> until

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
On May 8, 2011, at 11:09 AM, Jean-Christophe Deschamps wrote: > >> How does one go about finding out how many rows a query returns? > > This is the number of time sqlite3_step can be called successfully > until it returns SQLITE_DONE. I had it wrong in the email body, I

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Jean-Christophe Deschamps
>How about: > >SELECT count() FROM (); You can do that (and variations) but this is a completely distinct statement. I meant that there is no possibility to recover the row count of a result set before it goes to completion (by iterating step), just because the SQLite engine has no idea

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Samuel Adam
On Sun, 08 May 2011 11:09:36 -0400, Simon Slavin wrote: > > On 8 May 2011, at 4:00pm, Sam Carleton wrote: > >> How does one go about finding out how many rows a query returns? > > This was asked earlier this week. There is no magic way. Step through > the rows and

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Simon Slavin
On 8 May 2011, at 4:09pm, Simon Slavin wrote: > On 8 May 2011, at 4:00pm, Sam Carleton wrote: > >> Is there a >> way to find out the id of a particular column? > > It depends what you think a column's id is. But SQLite maintains a > pseudo-column of INTEGERs called 'id' or 'rowid' (several

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Simon Slavin
On 8 May 2011, at 4:00pm, Sam Carleton wrote: > How does one go about finding out how many rows a query returns? This was asked earlier this week. There is no magic way. Step through the rows and count them. You can, of course, do a preliminary SELECT for 'count(*)' and see what answer is

Re: [sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Jean-Christophe Deschamps
>How does one go about finding out how many rows a query returns? This is the number of time sqlite3_step can be called successfully until it returns SQLITE_DONE. >Is there a way to find out the id of a particular column? AFAICT column don't have ids. You can read column names or alias using

[sqlite] Determining how many columns were returned in a query

2011-05-08 Thread Sam Carleton
How does one go about finding out how many rows a query returns? Is there a way to find out the id of a particular column? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Samuel Adam
On Sun, 08 May 2011 09:36:43 -0400, Jean-Christophe Deschamps wrote: > Change that into: > > select date('2011-04-29', quote(-3) || ' day'); > > (note the space before day). > Looks like a parsing change. Apparently, yes, between the 3.6 and 3.7 lineages:

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Jean-Christophe Deschamps
Change that into: select date('2011-04-29', quote(-3) || ' day'); (note the space before day). Looks like a parsing change. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Teg
Hello Jan, Move it into it's own project, make it a static lib and turn down the warning level just for this project. That's what I do anyway. I'm not willing to touch the code but, that seems to be the only other solution. Sunday, May 8, 2011, 6:50:31 AM, you wrote: JB> Hi, JB> JB> I am

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Richard Hipp
On Sat, May 7, 2011 at 2:03 PM, Thomas Mittelstaedt < tmsta...@t-mittelstaedt.de> wrote: > Am Samstag, den 07.05.2011, 03:00 + schrieb > sqlite-mana...@googlecode.com: > > Comment #6 on issue 608 by mrinal.k...@gmail.com: select > date('2011-04-29', > > quote(-3) || 'day'); shows null after

Re: [sqlite] Issue 608 in sqlite-manager: select date('2011-04-29', quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17

2011-05-08 Thread Thomas Mittelstaedt
Am Samstag, den 07.05.2011, 03:00 + schrieb sqlite-mana...@googlecode.com: > Comment #6 on issue 608 by mrinal.k...@gmail.com: select date('2011-04-29', > quote(-3) || 'day'); shows null after upgrading of firefox to 3.6.17 > http://code.google.com/p/sqlite-manager/issues/detail?id=608 > >

Re: [sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Richard Hipp
On Sun, May 8, 2011 at 6:50 AM, Jan Berger wrote: > Hi, > > > > I am new to sqlite3 and just downloaded the code trying to test it from a > C++ application using Visual Studio 2010. I just created a class and > included the sqlite3.c and sqlite3.h from amalgamation-3070602

[sqlite] Compile error's on Visual Studio 2010

2011-05-08 Thread Jan Berger
Hi, I am new to sqlite3 and just downloaded the code trying to test it from a C++ application using Visual Studio 2010. I just created a class and included the sqlite3.c and sqlite3.h from amalgamation-3070602 directly. The header compiles fine, but on the sqlite3.c I get typecast errors.