Re: [sqlite] some help with datetime

2009-05-03 Thread Igor Tandetnik
"Gene Allen" wrote in message news:!&!AAAuAKY/0q6/55xppdwmexdclhybajwnk16tjt5kmprugns9ymeaem8aabafb8zhbqucrj+kez0vnifiaqaaa...@bystorm.com > I'm missing something simple since I can't seem to get it to work. > Here is an example of how I'm trying to get

Re: [sqlite] "COMMIT"

2009-05-03 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:760656.34138...@web90308.mail.mud.yahoo.com > I have read the sqlite document and document stated that: > The SQL command "COMMIT" does not actually commit the changes to > disk. It just turns autocommit back on. You omitted the next

Re: [sqlite] The details of the behavior of the sqlite3_step() interface

2009-05-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joanne Pham wrote: > I read the SQLite document about the sqlite3_step() as below: > The details of the behavior of the sqlite3_step() interface depend on > whether the statement was prepared using the newer "v2" interface > sqlite3_prepare_v2()

[sqlite] "COMMIT"

2009-05-03 Thread Joanne Pham
Hi All, I have read the sqlite document and document stated that:     The SQL command "COMMIT" does not actually commit the changes to disk. It just turns autocommit back on. The question is the default of database open connection is "autocommit" and if my function has :            

Re: [sqlite] How to create a table from a text file via c/c++ interface?

2009-05-03 Thread Griggs, Donald
Hi, Feng, I don't think that "load data from" is part of the sql standard -- I may be wrong. At any rate, the source code to the command line utility is freely available. When you wrote that "Using ' insert into values' ... is very time comsuming" did you mean time consuming to write the

[sqlite] some help with datetime

2009-05-03 Thread Gene Allen
Hello all, I have a table with a unixepoch column in it. I need to do some fancy calculation based on that time, hourly summaries, weekly averages, standard dev, etc.. Right now..I'm only using it for reporting and simple analysis and it's often formatted like this:

[sqlite] How to create a table from a text file via c/c++ interface?

2009-05-03 Thread knightfeng
Hi, '.import' can be used to create a table from text file in the command line version , but how can I do that using C/C++ interface? Using ' insert into values' by reading a text file line by line is very time comsuming and it seems that there is no such SQL command "LOAD DATA FROM"

[sqlite] The details of the behavior of the sqlite3_step() interface

2009-05-03 Thread Joanne Pham
Hi All, I read the SQLite document about the sqlite3_step() as below:     The details of the behavior of the sqlite3_step() interface depend on whether the statement was prepared using the newer "v2" interface sqlite3_prepare_v2() and sqlite3_prepare16_v2() or the older legacy interface

Re: [sqlite] sqlite3_finalize(sqlite3_stmt) is this call clean up thememory

2009-05-03 Thread Joanne Pham
Thanks a lot Igor for respond my email. JP From: Igor Tandetnik To: sqlite-users@sqlite.org Sent: Sunday, May 3, 2009 7:05:52 PM Subject: Re: [sqlite] sqlite3_finalize(sqlite3_stmt) is this call clean up thememory "Joanne Pham"

Re: [sqlite] sqlite3_finalize(sqlite3_stmt) is this call clean up thememory

2009-05-03 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:111052.72599...@web90308.mail.mud.yahoo.com > Is sqlite3_finalize(sqlite3_stmt) cleaning up the memory which is > allocated by sqlite_prepare()? > I checked the database statement handle before calling > sqlite3_finalize and after calling

[sqlite] sqlite3_finalize(sqlite3_stmt) is this call clean up the memory

2009-05-03 Thread Joanne Pham
Hi All, Is sqlite3_finalize(sqlite3_stmt) cleaning up the memory which is allocated by sqlite_prepare()? I checked the database statement handle before calling sqlite3_finalize and after calling this sqlite3_finalize the address is the same. I was wordering if the memory of database statement

Re: [sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Martin Engelschalk
Sorry, i forgot: my INT64 is the same as sqlite_int64 Martin Engelschalk wrote: > Hi, > > This is what i do, works for me. No OSX hovever, sorry. > > #ifdef _WIN32 > #define INT64 __int64 > #else > #define INT64 long long > #endif > > // From INT64 to String > > INT64 iOther; > char mBuffer[64];

Re: [sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Martin Engelschalk
Hi, This is what i do, works for me. No OSX hovever, sorry. #ifdef _WIN32 #define INT64 __int64 #else #define INT64 long long #endif // From INT64 to String INT64 iOther; char mBuffer[64]; #ifdef _WIN32 sprintf(mBuffer, "%I64d", iOther); #else sprintf(mBuffer, "%lld", iOther);

[sqlite] OT: how best to convert sqlite3_int64 to and from string in a cross platform fashion?

2009-05-03 Thread Sam Carleton
I am current developing a system only on Windows, but I do plan to port it to OSX someday. I am passing ID's as strings to keep maximum flexibility between databases and the existing system. So how do I convert a sqlite3_int64 to a string and a string to a sqlite3_int64 in a cross platform

Re: [sqlite] [newbie] How to upgrade sqlite3 in Ubuntu?

2009-05-03 Thread Derrell Lipman
On Sun, May 3, 2009 at 12:32 PM, scientist scientist < scientist92...@yahoo.com> wrote: > Thank you for your fast answer, but my problem still exists after I > followed your instructions. > > Firstly I removed the default sqlite3 using sudo apt-get remove sqlite3 > command. > After that I moved

Re: [sqlite] [newbie] How to upgrade sqlite3 in Ubuntu?

2009-05-03 Thread scientist scientist
Thank you for your fast answer, but my problem still exists after I followed your instructions. Firstly I removed the default sqlite3 using sudo apt-get remove sqlite3 command. After that I moved to the sqlite-3.6.13 folder which was extracted from sqlite-amalgamation-3.6.13.tar.gz and executed

Re: [sqlite] sqlite3_create_collation_v2 and SQLITE_UTF16_ALIGNED

2009-05-03 Thread D. Richard Hipp
On May 3, 2009, at 11:15 AM, Florian Weimer wrote: > The documentation suggests that I can pass SQLITE_UTF16_ALIGNED. > However, the logic in main.c:createCollation() assumes that > SQLITE_UTF16_ALIGNED is ORed with another encoding flag value > (presumably SQLITE_UTF16). If I specify

Re: [sqlite] [newbie] How to upgrade sqlite3 in Ubuntu?

2009-05-03 Thread Derrell Lipman
On Sun, May 3, 2009 at 11:37 AM, scientist scientist < scientist92...@yahoo.com> wrote: > Hi all, > My current Ubuntu version is 8.04 and it has sqlite3 3.4.2 by default. Now > I want to upgrade sqlite3 to its newest version. > I've already downloaded sqlite-amalgamation-3.6.13.tar.gz,

[sqlite] [newbie] How to upgrade sqlite3 in Ubuntu?

2009-05-03 Thread scientist scientist
Hi all, My current Ubuntu version is 8.04 and it has sqlite3 3.4.2 by default. Now I want to upgrade sqlite3 to its newest version. I've already downloaded sqlite-amalgamation-3.6.13.tar.gz, uncompressed the package and run the following commands: ../configure make sudo make install But when I

[sqlite] sqlite3_create_collation_v2 and SQLITE_UTF16_ALIGNED

2009-05-03 Thread Florian Weimer
The documentation suggests that I can pass SQLITE_UTF16_ALIGNED. However, the logic in main.c:createCollation() assumes that SQLITE_UTF16_ALIGNED is ORed with another encoding flag value (presumably SQLITE_UTF16). If I specify SQLITE_UTF16_ALIGNED alone, I end up with a crash due to a double free