Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Dan
On Jan 4, 2008, at 7:57 AM, Jerry Krinock wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using

RE: [sqlite] Date Problems

2008-01-03 Thread Wilson, Ron
> I could accept 28 Feb or 1 Mar as a > reasonable answer and I can make that point to my users. 365/12 = 30.4 2006/03/31 - 30 days = 2006/03/01 just subtract 30 days and be done with it. i think you can justify that to your customers. Ron Wilson, Senior Engineer, MPR Associates, 518.831.7546

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Jerry Krinock
On 2008 Jan, 03, at 17:21, Kees Nuyt wrote: If I understand the info at http://www.sqlite.org/c3ref/c_blob.html well, the INTEGER is always a 64-bit signed integer. Internally, integers are compressed, so they don't occupy eight bytes all the time. sqlite3_column_int64(); will always

RE: [sqlite] Date Problems

2008-01-03 Thread Moodie Keith
I think the logic might have been to subtract the number of days in the previous month from the current date. E.g. 2007/03/25 -28 (days in Feb) will give 2007/02/25 (spot on) 2007/10/31 -30 (days in Sept) will give 2007/10/01 (as good as you can get) 2007/09/30 -31 (days in Aug) will give

Re: [sqlite] Date Problems

2008-01-03 Thread John Stanton
Look at the Sqlite date functions. File date.c describes them. You may find that a custom function gives you exactly what you want. [EMAIL PROTECTED] wrote: Hi Kees Many thanks for your quick reply, but it doesn't give me the date i want. 2006/03/31 - 1 month should be 2006/02/28 whereas

RE: [sqlite] Date Problems

2008-01-03 Thread Griggs, Donald
regarding: >>2006/03/31 minus 1 month : I could accept 28 Feb or 1 Mar as a reasonable answer and I can make that point to my users. >>03 March is not reasonable, I can't think of any logic that would give me that answer and I'm not able to make any case. I believe the logic used is to

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Kees Nuyt
On Thu, 3 Jan 2008 16:57:12 -0800, Jerry Krinock <[EMAIL PROTECTED]> wrote: >I need to read an sqlite database generated by others. So I wrote an >outer loop which steps through the rows of a table using sqlite3_step, >and an inner loop which steps through the columns. The inner loop

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread John Stanton
An integer is always 64 bits. Jerry Krinock wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using

RE: [sqlite] Date Problems

2008-01-03 Thread Craig.Street
Hi Kees Many thanks for your quick reply, but it doesn't give me the date i want. 2006/03/31 - 1 month should be 2006/02/28 whereas select date('2006-03-31', 'start of month','-1 month') obviously gives me 2006/02/01 I need to be able to subtract 1 month from not just a single expression,

[sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Jerry Krinock
I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using sqlite3_column_type(), then 'switches' to get the value using

RE: [sqlite] a newbie

2008-01-03 Thread Scott Berry
Hi Cristopher, Actually this will be updated throughout the software's cycle because we need to always add new airports and information relating to them. Yup! You got it running on Windows Vista. I will check out Active Python and see what I can't come up with then. Scott -Original

RE: [sqlite] a newbie

2008-01-03 Thread Christopher Smith
> From: [EMAIL PROTECTED] > To: sqlite-users@sqlite.org > Date: Thu, 3 Jan 2008 15:21:47 -0600 > Subject: [sqlite] a newbie > > Hey guys, > > My name is Scott Berry and I am totally blind and a newbie to Sqlite. I > have two questions concerning Sqlite. The questions I have is I have an >

[sqlite] a newbie

2008-01-03 Thread Scott Berry
Hey guys, My name is Scott Berry and I am totally blind and a newbie to Sqlite. I have two questions concerning Sqlite. The questions I have is I have an Excel file which will be going in to the database for an aircraft program for the blind I am making. I want to turn this (Excel spreadsheet)

Re: [sqlite] Commit fails due to "database is locked" in active transaction

2008-01-03 Thread John Stanton
In a threaded environment the simple and effective solution is to synchronize your transactions with a mutex. You lose a little possible concurrency but if you do not need it you simplify the logic no end and have a more robust application. Using pthreads you can improve a little by using

Re: [sqlite] Commit fails due to "database is locked" in active transaction

2008-01-03 Thread Trevor Talbot
On 1/2/08, Lior Okman <[EMAIL PROTECTED]> wrote: > Trevor Talbot wrote: > > Requiring the second transaction to complete first is expected in > > terms of SQLIte's concurrency system. > So in terms of using SQLite, I need to close the entire transaction and > restart it when I get a "database

Re: [sqlite] Commit fails due to "database is locked" in active transaction

2008-01-03 Thread Richard Klein
Requiring the second transaction to complete first is expected in terms of SQLIte's concurrency system. So in terms of using SQLite, I need to close the entire transaction and restart it when I get a "database locked" return code in a writer thread? It's not enough to just retry the commit in

Re: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Kees Nuyt
On Thu, 3 Jan 2008 13:52:03 -0500, "Griggs, Donald" <[EMAIL PROTECTED]> wrote: >Maybe this is implied, but you might also try to .DUMP tables >*invididually* if .DUMP'ing the entire database fails. I didn't think of that, but yes, that is a good suggestion. I hope it helps the original poster.

RE: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Griggs, Donald
Regarding: >>I suspect the answer is no, but is there any way to salvage any of the data? >You could try the .dump command in the command line tool, but I'm afraid you're out of luck. Maybe this is implied, but you might also try to .DUMP tables *invididually* if .DUMP'ing

Re: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Kees Nuyt
Hi Doug, On Wed, 2 Jan 2008 21:47:45 -0600, "Doug" <[EMAIL PROTECTED]> wrote: >I have a customer that has a database that has somehow become corrupted. >I'm fairly certain he was on v3.4.1 but I'll double check. The database >isn't completely bad, I can look at the master table and one of the

[sqlite] Re: column index to name mapping

2008-01-03 Thread Fin Springs
> I'm not sure I understand the problem. The "zeroth" > row sqlite3_get_table > returns reports column > names. Isn't that sufficient? Thanks Igor, Please ignore my idiocy. I had quite forgotten they were in the 0th row. Apologies for the time waster. Dave

[sqlite] Re: column index to name mapping

2008-01-03 Thread Igor Tandetnik
Fin Springs <20dkom502-O/[EMAIL PROTECTED]> wrote: Is it possible to map column names to indices for sqlite3_get_table? I'm not sure I understand the problem. The "zeroth" row sqlite3_get_table returns reports column names. Isn't that sufficient? Igor Tandetnik

[sqlite] column index to name mapping

2008-01-03 Thread Fin Springs
Is it possible to map column names to indices for sqlite3_get_table? I could use sqlite3_prepare with my statement string and then calls to sqlite3_column_name() to build a mapping. I could then dispose of the prepared statement and make my call to sqlite3_get_table, relying on the column

Re: [sqlite] Possible UNICODE LIKE, upper(), lower() function solution

2008-01-03 Thread Cory Nelson
On Jan 3, 2008 4:10 AM, ioannis <[EMAIL PROTECTED]> wrote: > Dear all SQLite3 users, > > Recently i have been working on a dictionary style project that had to > work with UNICODE non-latin1 strings, i did try the ICU project but i > wasn't satisfied with the extra baggage that came with it. > I

[sqlite] Possible UNICODE LIKE, upper(), lower() function solution

2008-01-03 Thread ioannis
Dear all SQLite3 users, Recently i have been working on a dictionary style project that had to work with UNICODE non-latin1 strings, i did try the ICU project but i wasn't satisfied with the extra baggage that came with it. I would like to recommend the following possible solution to the long