Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Igor Tandetnik
Arbol One wrote: > //2 . ) create a table > sqlite3_stmt** stmt; Which part of "sqlite3_stmt* stmt;" did you find unclear? > std::string create_table("CREATE TABLE friend (name TEXT, address TEXT, age > INT)"); > rc = sqlite3_prepare_v2( > db, /* Database handle */ >

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Arbol One
Thanks Igor for your help, it is much appreciated. Now my step two looks like this //2 . ) create a table sqlite3_stmt** stmt; std::string create_table("CREATE TABLE friend (name TEXT, address TEXT, age INT)"); rc = sqlite3_prepare_v2( db, /* Database handle */ create_table.c_str() ,

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Igor Tandetnik
Arbol One wrote: > rc = sqlite3_open_v2(dbName.c_str(), , SQLITE_OPEN_READWRITE | > SQLITE_OPEN_CREATE, vfs.data()); Just pass NULL for the last parameter. There is very rarely a need to pass anything else. > *//2 . ) create a table > std::string create_table("CREATE

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
Thanks for the info. Yes, I read that page, but since the purpose of this exercise is to acquire a good understanding of SQLite under C++, I decided not to use the " *sqlite3_exec*" wrapper, but to execute each and every step of the development process. I know is not the fastest way, it

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Simon Slavin
On 17 Jun 2012, at 6:39pm, Arbol One wrote: > Now, my next step is to create data tables, but that will be on another email. It helps to read the documentation: See the end of that page for a C example. Simon.

[sqlite] Ticket 13137dccf36902cdd4e20c11d857c7ad7f5d8777 / FTS3 and last_insert_rowid()

2012-06-17 Thread skywind mailing lists
Hi, why is the above mentioned still open? It seems to be that the bug does not exist anymore under 3.7.7. Best regards, Hartwig ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Arbol One
int sqlite3_prepare_v2( sqlite3 *db, /* Database handle */ const char *zSql, /* SQL statement, UTF-8 encoded */ int nByte, /* Maximum length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ const char **pzTail /* OUT: Pointer to unused portion of zSql */ ); /***

Re: [sqlite] vfs?

2012-06-17 Thread Philip Bennefall
In that case you want to specify a NULL pointer for that argument. Then SqLite will pick an appropriate vfs to use for whatever platform it's being run on. Kind regards, Philip Bennefall - Original Message - From: "Arbol One" To: "General Discussion of

Re: [sqlite] vfs?

2012-06-17 Thread Arbol One
Thanks for your prompt respnse. Well, no, really. I don't know where my application will be used. Maybe someone will use it under linux or OS2, all I know is that now I am coding in Win32. - Original Message - From: Igor Tandetnik Sent: 06/17/12 02:02 PM To: sqlite-users@sqlite.org

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Stephan Beal
On Sun, Jun 17, 2012 at 8:35 PM, Stephan Beal wrote: > Pedantic note: cin.get() will wait for ENTER to be pressed before > returning, AFAIK. There is no portable way (in C/C++) to grab only the next > keystroke from the console. > But i was in doubt, so i checked...

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Stephan Beal
On Sun, Jun 17, 2012 at 7:39 PM, Arbol One wrote: > std::cout << "naaa, you ain't got it yet... press any key and keep > trying." << std::endl; > std::cin.get(); > Glad it helped. Pedantic note: cin.get() will wait for ENTER to be pressed before returning, AFAIK.

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Doug Currie
On Jun 17, 2012, at 12:23 PM, Keith Medcalf wrote: > SQLITE_SIGNIFICANT_DIGITS defaults to 14, but you can override it. No matter > what is requested, the maximum number of significant digits is limited to the > specification, and rounding is applied to the remaining bits of the >

Re: [sqlite] vfs?

2012-06-17 Thread Igor Tandetnik
Arbol One wrote: > Using C/C++, is there a way to extract which file system is SQLite using? You already know that - it's the one you've specified in a call to sqlite3_open_v2. What problem are you trying to solve? -- Igor Tandetnik

[sqlite] vfs?

2012-06-17 Thread Arbol One
Using C/C++, is there a way to extract which file system is SQLite using? TIA ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
Thanks Stephan for the help, with a little bit of reading and a lot of your help, I have come to understand how opening a data base file in SQLite is done. Here is a code I came up with: void mydb(){ std::string db_name("test"); std::string my_name("Programmer"); int my_age = MAX_INT;

Re: [sqlite] Improving performance of GROUP BY

2012-06-17 Thread Udi Karni
Thanks. There are no indexes of any kind because I would need many and they take very long to create. I am experimenting with various GROUP-BY scenarios like the following where all the work is done in TEMP. When TEMP is on disk - it finishes but is slower - when it's in memory - it's faster but

Re: [sqlite] How to run sql file in c++?

2012-06-17 Thread Stephan Beal
On Sun, Jun 17, 2012 at 2:50 PM, 叶艳红 wrote: > How to run sql file in c++? > I have a sql file contain any sql cmd and I will run the sql cmd file in > c++, > And I know use .read in sqlite shell cmd,but how to run the cmd in c++? > You do it the exact same way we described

[sqlite] How to run sql file in c++?

2012-06-17 Thread 叶艳红
How to run sql file in c++? I have a sql file contain any sql cmd and I will run the sql cmd file in c++, And I know use .read in sqlite shell cmd,but how to run the cmd in c++? ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] VERY weird rounding error

2012-06-17 Thread Etienne
Hi all, Here is a summary of my investigations related to the "0.1 case". [FYI, 8674146.01 is another example] The short (and censured :-) version: WTF!? That's just insane!!! Look at this (sqlite3.c compiled only ONE TIME with default options): [--- test.js: var db = new SQLite();

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Keith Medcalf
As long as the digit to the left of the decimal point is zero, and the digit immediately following the decimal point is non-zero, then yes. (ie, the same rules as apply for normalizing the coefficient in binary, where the most significant binary digit must be a one). Actually, you can

[sqlite] sqlite-3.7.13 fails to build with gcc2-.95.3

2012-06-17 Thread scottmc
The build of sqlite-3.7.13 fails to build with gcc2-.95.3 on a recent Haiku nightly build, near line 2650 of shell.c probably from this change: http://www.sqlite.org/cgi/src/info/93a0f452a7 Here's the error: libtool: link: gcc -shared .libs/sqlite3.o-O2 -Wl,-soname -Wl,libsqlite3.so.0 -o

Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Stephan Beal
On Sun, Jun 17, 2012 at 5:14 PM, Arbol One wrote: > rc = sqlite3_open_v2(db_name.c_str(), *??1*, , SQLITE_OPEN_READWRITE > | SQLITE_OPEN_CREATE, *??2*); > That is not the signature for open_v2: http://www.sqlite.org/c3ref/open.html > if(rc != SQLITE_OK){ >

[sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
int sqlite3_open_v2( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb, /* OUT: SQLite db handle */ int flags, /* Flags */ const char *zVfs /* Name of VFS module to use */ ); In my Windows 7 box, using MinGW I am trying to use sqlite in my c++ program, but the parameters

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Keith Medcalf
No references -- but everything is an estimate. Unlike decimal/BCD (IEEE 854-2008, GDAS, etc) you cannot map binary precision directly to decimal precision. This is especially true since your last bits of precision will suffer as you perform the conversion to decimal. I was always told (and

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Black, Michael (IS)
I think I figured out your "14" reference. What you mean is the number of fractional digits on the coefficient which equates to 15 significant digits including the single digit left of the decimal point. So your "expected precision" is really "scientific notation fractional precision". My

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Black, Michael (IS)
Do you have a reference for this? I found 3: Wikipedia says 16 http://en.wikipedia.org/wiki/IEEE_754-2008 BYU says 15 http://www.math.byu.edu/~schow/work/IEEEFloatingPoint.htm Oracle says 15-17 http://docs.oracle.com/cd/E19957-01/806-3568/ncg_math.html But I've never heard of "expected

Re: [sqlite] unicode61 FTS tokenizer

2012-06-17 Thread Richard Hipp
On Sun, Jun 17, 2012 at 4:23 AM, Baruch Burstein wrote: > Does the new FTS tokenizer `unicode61` depend on ICU? > No > > -- > ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı > ___ > sqlite-users mailing list >

[sqlite] unicode61 FTS tokenizer

2012-06-17 Thread Baruch Burstein
Does the new FTS tokenizer `unicode61` depend on ICU? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users