Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread dave lilley
2009/11/12 Rich Shepard > On Thu, 12 Nov 2009, dave lilley wrote: > > > Not trying to be silly here but why not write a wee program that reads in > > the dbf file and for each row read in write the data into an sql file? > > Because I'd have to research the format of

Re: [sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-11 Thread Dan Kennedy
On Nov 12, 2009, at 11:31 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Grzegorz Wierzchowski wrote: >> That was my first suspicion that there is some memmove with cursor >> object or so. >> This would mean that sqlite* or maybe other sensitive pointers can >>

Re: [sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Grzegorz Wierzchowski wrote: > That was my first suspicion that there is some memmove with cursor object or > so. > This would mean that sqlite* or maybe other sensitive pointers can not be > members of cursor object, what is wrong for me. There is

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Rich Shepard
On Thu, 12 Nov 2009, Jean-Christophe Deschamps wrote: > I'm pretty sure OpenOffice can do a number of such conversions, free and > portable. About command-line tools for linux, I just don't know. Perhaps. I learned today that only the Winduhs version of OO.o can import .mdb files; the linux

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Rich Shepard
On Thu, 12 Nov 2009, dave lilley wrote: > Not trying to be silly here but why not write a wee program that reads in > the dbf file and for each row read in write the data into an sql file? Because I'd have to research the format of the .dbf file and I'd probably be re-inventing the wheel.

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Reid Thompson
Reid Thompson wrote: > Jean-Christophe Deschamps wrote: >>>Now that I have a working tool to convert from Access .mdb to sqlitedb >>> files, I need one for dBASE .dbf files. Or, a conversion to .csv will >>> work, >>> too. Needs to run on linux, of course. > > perhaps >

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Reid Thompson
Jean-Christophe Deschamps wrote: > >>Now that I have a working tool to convert from Access .mdb to sqlitedb >> files, I need one for dBASE .dbf files. Or, a conversion to .csv will >> work, >> too. Needs to run on linux, of course. perhaps http://developer.berlios.de/projects/dbf/

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread Jean-Christophe Deschamps
>Now that I have a working tool to convert from Access .mdb to sqlitedb >files, I need one for dBASE .dbf files. Or, a conversion to .csv will >work, >too. Needs to run on linux, of course. > >My Google searches turned up a bunch of tools for the Windows > platforms, >supposedly free

Re: [sqlite] Converting .dbf to SQLite

2009-11-11 Thread dave lilley
Not trying to be silly here but why not write a wee program that reads in the dbf file and for each row read in write the data into an sql file? note the sql database & tables would be already created. in this message you don't really give an indication on whether you are able to do this or not

[sqlite] Converting .dbf to SQLite

2009-11-11 Thread Rich Shepard
Now that I have a working tool to convert from Access .mdb to sqlitedb files, I need one for dBASE .dbf files. Or, a conversion to .csv will work, too. Needs to run on linux, of course. My Google searches turned up a bunch of tools for the Windows platforms, supposedly free converters that

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Rick Ratchford
This is really not as difficult as you might think. If the database contains 10 years of price data, where trading only happens Monday-Friday excluding Holidays, and you were able to extract DATE RANGES as SETS from this data, it would not be difficult to determine if the SET is complete or not.

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Simon Slavin
On 11 Nov 2009, at 7:12pm, Rick Ratchford wrote: > To determine if the set is complete, there would clearly be data rows PRIOR > to the start date and data rows that FOLLOW the end date. This is how I'd > determine that a set is complete with all available data for those 'sample > date windows'.

Re: [sqlite] database is locked

2009-11-11 Thread Frank Chang
Jay Kreibich, Thank for your reply about sqlite3_busy_timeout. We found that the sqlite 'database is locked' error message can be fixed by updating two different tables in the two SQL Server 2005 client processes. UPDATE mdMatchUp SET MatchKey =

Re: [sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-11 Thread Grzegorz Wierzchowski
Wednesday 11 of November 2009 19:03:09 Roger Binns napisał(a): > Can you do this a unified diff please? > > In any case it looks like you are trying to manipulate the database pointer > while a query is running. > > Roger That was my first suspicion that there is some memmove with cursor object

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Rick Ratchford
Stock market data. Stock market only trades on Business days and not weekends and holidays. The database contains stock data. One row per trading day. What I want to do is to get all the data from a start date to end date only into individual sets. To determine if the set is complete, there

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Igor Tandetnik
Rick Ratchford wrote: > Only business days are in the data sets. No weekends or Holidays. > > So I was happy with the other sets because they ARE full sets. > > A full set is ALL THE BUSINESS DAYS from the Start to End Date. Do you have a table that lists all the

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Rick Ratchford
Only business days are in the data sets. No weekends or Holidays. So I was happy with the other sets because they ARE full sets. A full set is ALL THE BUSINESS DAYS from the Start to End Date. Cheers! Rick #>-Original Message- #>From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Grzegorz Wierzchowski wrote: > $ diff sqlite-3.6.20-BUG/src/test8.c sqlite-3.6.20-ORIGINAL/src/test8.c > 93d92 > < sqlite3 *pDb;/* Database connection */ > 572,574d570 > < if (pCur->pDb) > < sqlite3_close(pCur->pDb); > <

Re: [sqlite] Converting .mdb Files

2009-11-11 Thread Rich Shepard
On Wed, 11 Nov 2009, Jan wrote: > I am using this one: > http://code.google.com/p/mdb-sqlite/ > > Have not tried it on linux though. Jan, It's a java app so it should run on anything. What I need to do now is find the java ant tool on my system. Thanks, Rich

Re: [sqlite] optimization question

2009-11-11 Thread Tim Romano
Thank you, Igor. Processing time: 5 seconds. :-) Igor Tandetnik wrote: > Tim Romano wrote: > >> I've read http://www.sqlite.org/optoverview.html but don't find my >> answer there. >> >> In the following query, WOIDS has 4 million rows and CORNFIX has >> 25,000 rows. >>

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Igor Tandetnik
Rick Ratchford wrote: > #>> > #>> Date | Year | Month | Day > #>> > #>> 12/28/1988 1988 12 28 > #>> 12/29/1988 1988 12 29 > #>> 12/30/1988 1988 12 30 > #>> 01/04/1988 1988 01 04 > #>> 01/05/1988 1988 01 05 > #>> 12/28/1989 1989 12

Re: [sqlite] Output in currency format

2009-11-11 Thread Simon Slavin
On 11 Nov 2009, at 4:51pm, Fred Williams wrote: > The best (safest?) way I have found to handle non scientific math is to > work strictly with integers and multiply and divide using ROUND/TRUNC as > required to gain the precision required. This includes way more than > SQLite situations as

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Rick Ratchford
#>> #>> Date | Year | Month | Day #>> #>> 12/28/1988 1988 12 28 #>> 12/29/1988 1988 12 29 #>> 12/30/1988 1988 12 30 #>> 01/04/1988 1988 01 04 #>> 01/05/1988 1988 01 05 #>> 12/28/1989 1989 12 28 #>> 12/29/1989 1989 12 29 #>> 01/03/1989 1989 01

Re: [sqlite] Converting .mdb Files

2009-11-11 Thread Jan
Hi, I am using this one: http://code.google.com/p/mdb-sqlite/ Have not tried it on linux though. Jan Rich Shepard schrieb: >I have a 12.1M .mdb file (soils data) that I want to convert to SQLite. I > downloaded, built, and installed mdbtools-0.5 but it segfaults when I try to > run

Re: [sqlite] etiquette question: PNG attachments (28K, 11K) of EXPLAIN results permitted?

2009-11-11 Thread Keith Roberts
On Wed, 11 Nov 2009, Tim Romano wrote: > To: General Discussion of SQLite Database > From: Tim Romano > Subject: [sqlite] etiquette question: PNG attachments (28K, > 11K) of EXPLAIN results permitted? > > My update query has been running for

Re: [sqlite] optimization question

2009-11-11 Thread Kristoffer Danielsson
I solved my "inner/outer" problems by compiling Sqlite with SQLITE_ENABLE_STAT2=1. That flag makes it better at choosing the inner table! > To: sqlite-users@sqlite.org > From: itandet...@mvps.org > Date: Wed, 11 Nov 2009 12:03:06 -0500 > Subject: Re: [sqlite] optimization question > > Tim

Re: [sqlite] Need help constructing a query

2009-11-11 Thread Igor Tandetnik
Jörgen Hägglund wrote: > Hi all! > I have three tables, one containing IP addresses as integers, lets > call > it 'base'. > A second table containing IP ranges and the country code the range > belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as >

Re: [sqlite] Output in currency format

2009-11-11 Thread Fred Williams
The best (safest?) way I have found to handle non scientific math is to work strictly with integers and multiply and divide using ROUND/TRUNC as required to gain the precision required. This includes way more than SQLite situations as well. Borland (Code Gear) seem to be the only developer

[sqlite] etiquette question: PNG attachments (28K, 11K) of EXPLAIN results permitted?

2009-11-11 Thread Tim Romano
My update query has been running for 45 minutes, and I'm not sure how to stop it. I think it's selecting a row from a table with 25,000 rows 4 million times rather than selecting a row from a table with 4 million rows 25,000 times. To prevent this in the future, I need to learn more about how

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread Jay A. Kreibich
On Wed, Nov 11, 2009 at 08:04:23AM -0800, Peter Haworth scratched on the wall: > The group_concat function works fine in the Firefox SQLite Manager > extension on the same Mac where it fails within sqlite3. Also, the > development software I'm using (Revolution) also rejects the >

Re: [sqlite] sqlite3_analyzer with 3.6.19 distribution

2009-11-11 Thread D. Richard Hipp
On Nov 11, 2009, at 11:24 AM, Jens Miltner wrote: > > Is sqlite3_analyzer supposed to work in 3.6.19? > No. sqlite3_analyzer has been busted for a long time. But the 3.6.0 version of sqlite3_analyzer works just fine, even on databases created using 3.6.19. D. Richard Hipp d...@hwaci.com

[sqlite] Converting .mdb Files

2009-11-11 Thread Rich Shepard
I have a 12.1M .mdb file (soils data) that I want to convert to SQLite. I downloaded, built, and installed mdbtools-0.5 but it segfaults when I try to run mdb-schema and mdb-export on the soils data. The -0.6pre1 won't build because the backend.c file is declared both static and dynamic. I

[sqlite] sqlite3_analyzer with 3.6.19 distribution

2009-11-11 Thread Jens Miltner
Hi, I just tried to build the sqlite3_analyzer from the 3.6.19 distribution on Mac OS X (using 'make sqlite3_analyzer'), but when I run the tool, I get the following error: > Analyzing table agent_registry... > ERROR: invalid command name "btree_cursor_info" > invalid command name

Re: [sqlite] Output in currency format

2009-11-11 Thread P Kishor
On Wed, Nov 11, 2009 at 10:07 AM, Peter Haworth wrote: > Seems like I should handle the formatting in my application.  Not sure > I agree that sqlite is not the place to do output formatting - it > provides lots of date and time formatting features so at least in that >

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread P Kishor
On Wed, Nov 11, 2009 at 10:04 AM, Peter Haworth wrote: > Yes, the analyzer is the only precompiled binary I see on the sqlite > download page > > The group_concat function works fine in the Firefox SQLite Manager > extension on the same Mac where it fails within sqlite3.  

Re: [sqlite] Output in currency format

2009-11-11 Thread Peter Haworth
Seems like I should handle the formatting in my application. Not sure I agree that sqlite is not the place to do output formatting - it provides lots of date and time formatting features so at least in that area, output formatting is available. Thanks also for the info re accuracy/REAL

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread Peter Haworth
Yes, the analyzer is the only precompiled binary I see on the sqlite download page The group_concat function works fine in the Firefox SQLite Manager extension on the same Mac where it fails within sqlite3. Also, the development software I'm using (Revolution) also rejects the

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > > i`ve done it, and i think i understand it :) > > thank you.. > > > few more question to be sure that i`m not missing something important.. > > if i use prepared statements only (dont use exec function in program at all) > i dont need callback function,

[sqlite] optimization question

2009-11-11 Thread Tim Romano
I've read http://www.sqlite.org/optoverview.html but don't find my answer there. In the following query, WOIDS has 4 million rows and CORNFIX has 25,000 rows. UPDATEWOIDS SET corn = 1 WHERE EXISTS ( SELECT * FROM CORNFIX WHERE (cornfix.col_1 =

Re: [sqlite] Need help constructing a query

2009-11-11 Thread Jay A. Kreibich
On Wed, Nov 11, 2009 at 09:36:41AM -0600, P Kishor scratched on the wall: > 2009/11/11 Jörgen Hägglund : > > Hi all! > > I have three tables, one containing IP addresses as integers, lets call > > it 'base'. > > A second table containing IP ranges and the country code

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread TTTTT
i`ve done it, and i think i understand it :) thank you.. few more question to be sure that i`m not missing something important.. if i use prepared statements only (dont use exec function in program at all) i dont need callback function, do i? somehow after i replaced exec (i.e.

Re: [sqlite] Need help constructing a query

2009-11-11 Thread P Kishor
2009/11/11 Jörgen Hägglund : > Hi all! > I have three tables, one containing IP addresses as integers, lets call > it 'base'. > A second table containing IP ranges and the country code the range > belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as >

Re: [sqlite] SQLite in C# .NET

2009-11-11 Thread Robert Simpson
This has been asked and answered several times in the forums: http://sqlite.phxsoftware.com/forums -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Matthew Pulis Sent: Wednesday, November 11, 2009 6:40 AM To:

[sqlite] Need help constructing a query

2009-11-11 Thread Jörgen Hägglund
Hi all! I have three tables, one containing IP addresses as integers, lets call it 'base'. A second table containing IP ranges and the country code the range belongs to. Lets call this 'IPtoCC' with the fields IPFrom and IPTo as integers and CC as text. Then a third, 'Exclude', containing

[sqlite] When should you move to R*Tree?

2009-11-11 Thread Fredrik Karlsson
Dear list, I am writing small program for large-ish databases involving multiple (nested) comparisons of time references (REAL) against time intervals (also REAL) stored as max and min points (i.e. "is this time point within the intervals I have stored in table X?") At what point, in terms of

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread William Kyngesburye
I have a SQLite3 framework. Universal binaries for Tiger thru Snow Leopard (though I'm not maintaining for Tiger any more). http://www.kyngchaos.com/software:frameworks On Nov 10, 2009, at 3:07 PM, Peter Haworth wrote: > sqlite3 is rejecting a SELECT statement that includes the group_concat

Re: [sqlite] sqlite3_free()

2009-11-11 Thread Simon Davies
2009/11/11 T : > > is this right way how to do it: > > sqlite_free (errmsg); > > ??? > > > or this: > > > sqlite3_free (NULL); >From http://www.sqlite.org/c3ref/free.html: "The sqlite3_free() routine is a no-op if is called with a NULL pointer." > > or how should i do

Re: [sqlite] sqlite3_free()

2009-11-11 Thread TTTTT
is this right way how to do it: sqlite_free (errmsg); ??? or this: sqlite3_free (NULL); or how should i do it? -- View this message in context: http://old.nabble.com/sqlite3_free%28%29-tp5188068p26302585.html Sent from the SQLite mailing list archive at Nabble.com.

Re: [sqlite] sqlite3_free()

2009-11-11 Thread TTTTT
jalburger wrote: > > > > > By "the same" I mean the same sequence of bytes. The error message > from sqlite3_exec() is always obtained from a malloc-like memory > allocator and must be freed using sqlite3_free(). The error message > returned by sqlite3_errmsg() is always a constant,

Re: [sqlite] [SOLVED] Problems passing parameters between SQLite + TCL

2009-11-11 Thread Walter Dnes
On Wed, Nov 11, 2009 at 02:41:50AM -0500, Walter Dnes wrote > proc sql_distance {lat1, long1, lat2, long2} { It seems that "the TCL way" to pass multiple parameters is... proc sql_distance {lat1 long1 lat2 long2} { i.e. as a list without any commas. -- Walter Dnes

Re: [sqlite] Understanding database lock

2009-11-11 Thread P Kishor
There are many problems with your code. See below. On Wed, Nov 11, 2009 at 12:50 AM, Akash Rao wrote: .. > I have a perl script that add numbers 1-1000 into a db. > > Here is the code: > = > use DBI; > > my $number; > > for ($number=0;$number <=

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > . . . > >> and finaly i get SQLITE_DONE but it still doesnt show me table i have >> selected... > > See http://www.sqlite.org/c3ref/column_blob.html > > > i dont understand what exactly do you mean.. > > combination of these: > > sqlite3_value

[sqlite] SQLite in C# .NET

2009-11-11 Thread Matthew Pulis
Hi guys, I am trying to do a small GIS for a mobile application. My application is targeting Windows Mobile 6 Professional Edition. I am using CF 3.5 of .NET. I have included the .dll from here:

Re: [sqlite] Reverse Referencing Rows

2009-11-11 Thread Olaf Schmidt
"Rick Ratchford" schrieb im Newsbeitrag news:dbfb2606d0c1448b930064474496a...@dolphin... > A while back, Igor gave me some help on pulling out mm/dd ranges (sets) from > my table. > > This is the code that does that. > > sSQL = "SELECT Date, Year, Month, Day, Open,

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Marcus Grimm
you may also take a look at: http://www.sqlite.org/cvstrac/wiki?p=SimpleCode it explains how to use the step mechanism. hth Marcus > > > why not: > int smth = sqlite3_step (statement2); > while( smth == SQLITE_ROW ) > { > printf( "\n command= %s result code = %d \n",

[sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-11 Thread Grzegorz Wierzchowski
Sorry for long message, but this is required to explain my point. Message is intended mainly to SQLite developers according new workflow for announcing bug candidates; regular users espacially those not using modules may skip it. It looks like virtual tables' interface do not allow for doing

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread TTTTT
why not: int smth = sqlite3_step (statement2); while( smth == SQLITE_ROW ) { printf( "\n command= %s result code = %d \n", command, smth ); smth = sqlite3_step (statement2); } so that it will work no matter how many rows because I dont have much experience :)

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > > i think i understand why it doesnt work for select *.. > > because sqlite_step executes one row at time.. so after i prepare SELECT * , > i need to use sqlite_step as many times as table i`m selecting from has rows > (in this case 3 times).. > so i made

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread TTTTT
i think i understand why it doesnt work for select *.. because sqlite_step executes one row at time.. so after i prepare SELECT * , i need to use sqlite_step as many times as table i`m selecting from has rows (in this case 3 times).. so i made another function that looks like this: bool

[sqlite] Feature suggestion - default busy handler

2009-11-11 Thread O'Neill, Owen
Hi Everyone, On the basis of the number of times it comes up on the mailing list, and the grounds that most 'casual' users will want Sqlite to work as well as possible 'out the box' - I'd like to suggest the that the default busy handler is changed from being none to being the 'standard' busy

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread Dan Kennedy
On Nov 11, 2009, at 12:13 PM, Jay A. Kreibich wrote: > On Wed, Nov 11, 2009 at 11:23:18AM +0700, Dan Kennedy scratched on > the wall: >> >> On Nov 11, 2009, at 4:07 AM, Peter Haworth wrote: >> >>> sqlite3 is rejecting a SELECT statement that includes the >>> group_concat >>> function saying

[sqlite] execute or prepare+step+finalize

2009-11-11 Thread TTTTT
Hello everyone! i have been using function select_statement to execute SQL statements as SELECT, CREATE, DROP, INSERT etc.. then i`ve replaced insert by bind function because you ve told me about various advantages it has over insert. now i have realized that in official documentation is also

Re: [sqlite] Understanding database lock

2009-11-11 Thread Akash Rao
Roger, Thanks. I have read this a few times. But, i am trying to figure out how the perl DBI for sqlite works with Sqlite's lock. Any perl gurus here, please help. Thanks, Akash On Wed, Nov 11, 2009 at 12:42 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- >

Re: [sqlite] any keyword

2009-11-11 Thread Walter Dnes
On Wed, Nov 11, 2009 at 09:37:31AM +0100, Andrea Galeazzi wrote > Probably sqlite doesn't support 'any' keyword as I write it in the > following query: > SELECT G.id,name FROM Genre G > WHERE G.id = ANY (SELECT S.genre_id FROM Song S) > ORDER BY name ASC; Maybe I'm mis-understanding your

Re: [sqlite] any keyword

2009-11-11 Thread Jonas Sandman
Don't you just want to use IN? SELECT G.id,name FROM Genre G WHERE G.id IN (SELECT S.genre_id FROM Song S) ORDER BY name ASC; /Jonas On Wed, Nov 11, 2009 at 9:48 AM, Artur Reilin wrote: > Does it required the any key? Doesn't it work without it? > > greetings > >

Re: [sqlite] any keyword

2009-11-11 Thread Artur Reilin
Does it required the any key? Doesn't it work without it? greetings > Probably sqlite doesn't support 'any' keyword as I write it in the > following query: > SELECT G.id,name FROM Genre G > WHERE G.id = ANY (SELECT S.genre_id FROM Song S) > ORDER BY name ASC; > > In

[sqlite] any keyword

2009-11-11 Thread Andrea Galeazzi
Probably sqlite doesn't support 'any' keyword as I write it in the following query: SELECT G.id,name FROM Genre G WHERE G.id = ANY (SELECT S.genre_id FROM Song S) ORDER BY name ASC; In this case I can write an equivalent query like: select G.id,name from Genre G WHERE (SELECT COUNT(*) FROM Song

Re: [sqlite] Problems passing parameters between SQLite + TCL

2009-11-11 Thread Brett Schwarz
> > > > Here is the cut-down program... > > > #!/usr/bin/tclsh > set lat_degrees [expr [lindex $argv 0]] > set long_degrees [expr [lindex $argv 1]] >