[sqlite] WxDevCpp and Sqlite 3.4.1

2007-08-09 Thread Massimiliano Marini
Hi all, Under linux I've no problems with g++ I've compiled sqlite 3.4.1 and created a makefile with the parameters (include,library) where I compile the main.cpp and all is right. I want to compile the same file main.cpp under WxDevCpp but I don't know how setup sqlite 3.4.1. Under linux I've

Re: [sqlite] New User: Creating/Modifying tables

2007-08-09 Thread Michael Hooker
How do I create/alter tables with a GUI?<< Short of buying some kind of commercial pre-written db manager, you could use the DisqLite3 you already have to write something in Delphi which you already have. All you really need is an edit control into which you put your SQLite3 statements and

Re: [sqlite] UNION?

2007-08-09 Thread T
Hi Lee, This query does not work in SQLite but works in MS SQL Server: sqlite> SELECT items_idx, [name], active FROM Items ...> WHERE active = 'T' AND Items.items_idx IN ...> ((SELECT related_item FROM RelatedItems WHERE item = 1777) ...> UNION ...> (SELECT item FROM RelatedItems

RE: [sqlite] UNION?

2007-08-09 Thread Tom Briggs
> Also, you may want to consider avoiding performing an IN on a UNION. > As far as I know, SQLite doesn't optimize that, so will build the > entire union before performing the IN. If you instead do the > following, it should be a lot faster (if you have lots of data). But > I may be

Re: [sqlite] WxDevCpp and Sqlite 3.4.1

2007-08-09 Thread Clay Dowling
If you want to use a DLL then you should download the DLL and the source package. Create an import library against the DLL with dlltool and put the resulting libsqlite.a into your libs folder. Copy sqlite3.h from the source distribution into your includes folder. If you'd rather be statically

[sqlite] auto_increment - why does it do the opposite?

2007-08-09 Thread Paul Harris
Hi, Can someone please explain why adding the auto_increment term seems to STOP the auto_increment behaviour? $ sqlite3 SQLite version 3.3.17 Enter ".help" for instructions sqlite> .headers on sqlite> create table abc (id integer auto_increment primary key, value text); sqlite> insert into abc

[sqlite] Re: auto_increment - why does it do the opposite?

2007-08-09 Thread Paul Harris
On 09/08/07, Paul Harris <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone please explain why adding the auto_increment term seems to > STOP the auto_increment behaviour? > > $ sqlite3 > SQLite version 3.3.17 > Enter ".help" for instructions > sqlite> .headers on > sqlite> create table abc (id

[sqlite] Updating two tables

2007-08-09 Thread koen
Hi, I'm sure this is just a beginner's question, but I have been unable to find the answer elsewhere. As I am indeed just a beginner (wrt SQL/sqlite), please bear with me... Suppose I create two tables: CREATE TABLE tblA ( idA PRIMARY KEY UNIQUE ); CREATE TABLE tblB ( idB PRIMARY KEY

[sqlite] Creating index takes over an hour

2007-08-09 Thread mos
I'm building my first index on a large table using the "Create index ix_Main on Table1(StringField1,StringField2,DateField,TimeField)" and so far it has been running over an hour on a fast computer with 2gb ram. There are 15 million rows in the table. The same index can be built in MySQL in a

Re: [sqlite] Re: auto_increment - why does it do the opposite?

2007-08-09 Thread Paul Harris
ok... That explains how autoincrement works, but it doesn't explain why the AUTO_INCREMENT keyword made it through the parser without raising an error or doing what I would expect - and work as an AUTOINCREMENT table. perhaps, it is the same reason this works: sqlite> create table abc (id not

Re: [sqlite] Re: auto_increment - why does it do the opposite?

2007-08-09 Thread miguel manese
Igor has answered this before. Roughly: 1. all tables has an implicit integer column named "rowid" that is auto increment 2. creating an integer primary key effectively "renames" rowid to that column, so in your case below fields id and rowid are the same IIRC drh replied something else, and

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Paul Harris
Hi Mike, i have noticed that things take a lot longer if they aren't surrounded by a BEGIN; do work; COMMIT; does that make a difference for you? Paul On 09/08/07, mos <[EMAIL PROTECTED]> wrote: > I'm building my first index on a large table using the "Create index > ix_Main on

Re: [sqlite] WxDevCpp and Sqlite 3.4.1

2007-08-09 Thread Massimiliano Marini
[cut] Tnx Clay -- Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/ "It's easier to invent the future than to predict it." -- Alan Kay

Re: [sqlite] In-Memory Database: Delete rows on a Table increases the memory usage.

2007-08-09 Thread Babu, Lokesh
Does anybody knows the exact code, a little hack where can I free up the memory, I don't want it to use it for future requests. Even drop table consumes memory. :-(. If we are doing in-memory database operation, why do we want to maintain the free'd memory pages? I think If Mr. Hipp answers, it

RE: [sqlite] File Permission and Busy Handler Issue in SQLite

2007-08-09 Thread Ken
Kiran, I understand where you are coming from with this. With that said here are my thoughts: 1. It is not sqlite's responsibility to make sure that your db is writable. After all either you/and/or the application has made it not writeable. Sqlite has a reasonable expectation that underlying

RE: [sqlite] Re: auto_increment - why does it do the opposite?

2007-08-09 Thread Griggs, Donald
Regarding: " This works, probably because sqlite doesn't enforce column types..." Yes, you can create table ABC ( myCol WARM_AND_FUZZY); And this will be parsed without error. - To unsubscribe, send email to

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Joe Wilson
If your database file is less than the size of your RAM, then do this before the create index to speed it up: cat your.db > /dev/null See also: PRAGMA cache_size = number-of-pages; and PRAGMA page_size = bytes; -- recommend at least 8192 http://www.sqlite.org/pragma.html --- mos

[sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread drh
We are considering a change to the SQLite API which is technically not backwards compatible. On the other hand, it is difficult to imagine a situation where the change would cause anyone any serious hardship. We suspect that most people will consider this change a vast improvement. The proposed

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread mos
At 10:19 AM 8/9/2007, you wrote: If your database file is less than the size of your RAM, then do this before the create index to speed it up: cat your.db > /dev/null See also: PRAGMA cache_size = number-of-pages; and PRAGMA page_size = bytes; -- recommend at least 8192

RE: [sqlite] In-Memory

2007-08-09 Thread Uma Krishnan
Great! Thanks a lot - Uma [EMAIL PROTECTED] wrote: from sqlite3 import dbapi2 as sqlite connection = sqlite.connect(':memory:') cursor.execute(' . . . sql statements . . .') cursor.close() Whatever sql operations you do will be in memory. Once you exit the applcation, DB will be lost

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > We are considering a change to the SQLite API which is > technically not backwards compatible. On the other hand, > it is difficult to imagine a situation where the change > would cause anyone any serious hardship. We suspect that > most people will consider this

RE: [sqlite] UNION?

2007-08-09 Thread Lee Crain
I agree, Jim, it "would have been nice...". When I first posted about the problem I was having, I had gone through so SQL many experiments trying to get the query to work that had I lost track of which variations I had tried on which DBMS's. I inadvertently posted one of my versions of the query

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread John Stanton
Definite enhancement without a downside from our perspective. [EMAIL PROTECTED] wrote: We are considering a change to the SQLite API which is technically not backwards compatible. On the other hand, it is difficult to imagine a situation where the change would cause anyone any serious

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Joe Wilson
--- mos <[EMAIL PROTECTED]> wrote: > At 10:19 AM 8/9/2007, you wrote: > >If your database file is less than the size of your RAM, > >then do this before the create index to speed it up: > > > > cat your.db > /dev/null > > Using Windows XP. :-0 Anyone know a simple Windows command line

RE: [sqlite] UNION?

2007-08-09 Thread Lee Crain
Tom, Thanks for taking the time to document for my benefit more efficient implementations. Lee Crain __ -Original Message- From: T [mailto:[EMAIL PROTECTED] Sent: Thursday, August 09, 2007 4:08 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] UNION? Hi Lee, >

[sqlite] Re: Updating two tables

2007-08-09 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: Suppose I create two tables: CREATE TABLE tblA ( idA PRIMARY KEY UNIQUE ); CREATE TABLE tblB ( idB PRIMARY KEY UNIQUE, A NOT NULL ); Now, I would like to add a number of rows to tblB, one row to tblA, and map each new row in tblB to the new row in tblA by setting

Re: [sqlite] In-Memory Database: Delete rows on a Table increases the memory usage.

2007-08-09 Thread Joe Wilson
--- "Babu, Lokesh" <[EMAIL PROTECTED]> wrote: > Does anybody knows the exact code, a little hack where can I free up the > memory, I don't want it to use it for future requests. > > Even drop table consumes memory. :-(. > > If we are doing in-memory database operation, why do we want to maintain

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Marco Bambini
We'll be more than happy with a change like that. --- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On Aug 9, 2007, at 5:37 PM, [EMAIL PROTECTED] wrote: We are considering a change to the SQLite API which is technically not backwards

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Mike Johnston
Game on!! We'd love to see this happen. [EMAIL PROTECTED] wrote: We are considering a change to the SQLite API which is technically not backwards compatible. On the other hand, it is difficult to imagine a situation where the change would cause anyone any serious hardship. We suspect that most

[sqlite] incredible slow performance of a trigger

2007-08-09 Thread Zlatko Matic
Hello. I have terrible performance when executing the following query, which inserts rows from table "products" to table "bom_products": INSERT INTO bom_products ( plant, product, product_description, product_base_qty_units, product_base_qty) SELECT DISTINCT

RE: [sqlite] Creating index takes over an hour

2007-08-09 Thread Griggs, Donald
Regarding: > > cat your.db > /dev/null > > Using Windows XP. :-0 --- >Anyone know a simple Windows command line equivalent of the cat to dev null command above to put a file into OS cache? >You could write a small C program to do this, I suppose.

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Brad Stiles
> > > cat your.db > /dev/null > > > > > Using Windows XP. :-0 > > Anyone know a simple Windows command line equivalent of the cat > to dev null command above to put a file into OS cache? Well, 'type your.db > nul' will do the same thing, though whether or not it will remain in the cache

Re: [sqlite] New User: Creating/Modifying tables

2007-08-09 Thread Zlatko Matic
Has anybody successfuly ported DISQLite3 from Delphi to Lazarus? - Original Message - From: "Michael Hooker" <[EMAIL PROTECTED]> To: Sent: Thursday, August 09, 2007 9:47 AM Subject: Re: [sqlite] New User: Creating/Modifying tables How do I create/alter

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Joe Wilson
Do you also intend to use just a single file descriptor for all connections to the same database file in the same process? --- [EMAIL PROTECTED] wrote: > We are considering a change to the SQLite API which is > technically not backwards compatible. On the other hand, > it is difficult to

Re: [sqlite] Re: Updating two tables

2007-08-09 Thread Koen Vermeer
Op donderdag 09-08-2007 om 12:26 uur [tijdzone -0400], schreef Igor Tandetnik: > I'm not sure I understand the problem. Can't you insert into A, retrieve > the last ID into a variable in your program, then use the value of this > variable for all subsequent inserts into B? Yes, I did forget to

[sqlite] Re: Re: Updating two tables

2007-08-09 Thread Igor Tandetnik
Koen Vermeer <[EMAIL PROTECTED]> wrote: Op donderdag 09-08-2007 om 12:26 uur [tijdzone -0400], schreef Igor Tandetnik: I'm not sure I understand the problem. Can't you insert into A, retrieve the last ID into a variable in your program, then use the value of this variable for all subsequent

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread mos
At 12:10 PM 8/9/2007, you wrote: > > > cat your.db > /dev/null > > > > > Using Windows XP. :-0 > > Anyone know a simple Windows command line equivalent of the cat > to dev null command above to put a file into OS cache? Well, 'type your.db > nul' will do the same thing, though whether or not

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Ian Frosst
A most welcome modification. On 8/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > We are considering a change to the SQLite API which is > technically not backwards compatible. On the other hand, > it is difficult to imagine a situation where the change > would cause anyone any serious

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Joe Wilson
--- mos <[EMAIL PROTECTED]> wrote: > Is there no way to allocate more memory to SQLite index buffers like you > can with MySQL and most other databases? I suspect SQLite is building the > index on disk which will be 100x slower than if it used RAM. The indexing > process has used 400MB of RAM

[sqlite] Read Only DB

2007-08-09 Thread Igor Mironchick
Hi. How can I open DB in read-only mode? -- Regards, Igor Mironchick, Intervale © #ICQ 492-597-570 - To unsubscribe, send email to [EMAIL PROTECTED]

[sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
Hi I am using the 'quick start' C-styled code for sqlite3 http://www.sqlite.org/quickstart.html I think I'm running into a problem trying to put it in classes to make it somewhat object oriented. So I'm asking for help about how to make it object-oriented - or to confirm whether what

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread mos
At 01:42 PM 8/9/2007, you wrote: --- mos <[EMAIL PROTECTED]> wrote: > Is there no way to allocate more memory to SQLite index buffers like you > can with MySQL and most other databases? I suspect SQLite is building the > index on disk which will be 100x slower than if it used RAM. The indexing >

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Dwight Ingersoll
> Anyone know a simple Windows command line equivalent > of the cat to dev null command above to put a file > into OS cache? The command would be: type filename.db > nul but I'm pretty sure that this does not work the same way under Windows as it does in *Nix.

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Igor Mironchick
If I understand you right then try it: static int add_value( void *st, int, char **value, char ** ) { storage_t * storage = (storage_t*) st; st->push( value[ 0 ] ); return SQLITE_OK; }; class storage_t { public: storage_t() :m_db( 0 ) { sqlite3_open(

RE: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Lee Crain
Stephen, I was faced with a similar problem while writing a SQLite API wrapper for our application programmers. My solution was this: > I created a Field class that is a container than can hold ONE of several different data types. > I created a Record class that consists of a vector of Fields

RE: [sqlite] File Permission and Busy Handler Issue in SQLite

2007-08-09 Thread Dwight Ingersoll
--- Kiran <[EMAIL PROTECTED]> wrote: > This make me suspect that there is some point which > I am missing or may be it is a defect in SQLite. I wouldn't necessarily call a product defective simply because it didn't behave in the manner you expected or wished it to. Considering what I've seen

RE: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Lee Crain
The formatting on part of my response didn't turn out as I expected. I'll try that part again: Think of a vRecordset vector like this, as a vector of vRecord vectors: vRecord0< Field0, Field1, Field2, FieldN > vRecord1< Field0, Field1, Field2, FieldN > vRecord2< Field0, Field1, Field2,

Re: [sqlite] Re: Re: Updating two tables

2007-08-09 Thread Koen Vermeer
Op donderdag 09-08-2007 om 14:01 uur [tijdzone -0400], schreef Igor Tandetnik: > > Yes, I did forget to mention: I would like to wrap the statements into > > one transaction. > Feel free to. Nothing I said would prevent you from doing that. > > Besides, doing an insert, select and again a number >

Re: [sqlite] incredible slow performance of a trigger

2007-08-09 Thread Marco Antonio Abreu
Hi Zlatko, In your commands, I did't find table "stocks" used in view "qry_stocks_sum". In any case, try to use SQLite default types, like REAL and TEXT in place of FLOAT and VARCHAR. The type "VARCHAR(0)" is not indicated for field type and length, please use some thing like "TEXT(40)".

Re: [sqlite] Creating index takes over an hour

2007-08-09 Thread Joe Wilson
--- mos <[EMAIL PROTECTED]> wrote: > At 01:42 PM 8/9/2007, you wrote: > >--- mos <[EMAIL PROTECTED]> wrote: > > > Is there no way to allocate more memory to SQLite index buffers like you > > > can with MySQL and most other databases? I suspect SQLite is building the > > > index on disk which will

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Ken
Does this mean that the "shared_cached" connections in two threads can access the same DB cache and database in parallel? I'm all for it, either way it should be an improvement. Thanks DRH for a great product. Ken [EMAIL PROTECTED] wrote: We are considering a change to the SQLite API which

RE: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Robert Simpson
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 09, 2007 8:38 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] Proposed incompatible change to SQLite > > We are considering a change to the SQLite API which is > technically not

[sqlite] [Visual Basic] How do you work with SQLite?

2007-08-09 Thread Gilles Ganault
Hello I was wondering: how do you VB developpers work with SQLite? Currently, I use a variant array that I fill with data from SQLite, and use ComponentOne's grid object to display the data through its LoadArray() method; If/once the data is updated by the user, I write the array back to

Re: [sqlite] incredible slow performance of a trigger

2007-08-09 Thread Zlatko Matic
Hi! Here is the table "stocks": CREATE TABLE [stocks] ( [stocks_id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, [plant] VARCHAR(0) NULL, [material] VARCHAR(0) NULL, [material_description] VARCHAR(0) NULL, [material_type] VARCHAR(0) NULL, [material_batch] VARCHAR(0) NULL,

RE: [sqlite] [Visual Basic] How do you work with SQLite?

2007-08-09 Thread RB Smissaert
I use it mainly to manipulate data obtained from an Interbase database. All the data will eventually be dumped to Excel. I use 2 ways to move data from Interbase to SQLite. One, via an ADO recordset after connecting to Interbase with ODBC. This recordset will then be dumped to SQLite via the free

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Dennis Cote
Stephen Sutherland wrote: Hi I am using the 'quick start' C-styled code for sqlite3 http://www.sqlite.org/quickstart.html I think I'm running into a problem trying to put it in classes to make it somewhat object oriented. So I'm asking for help about how to make it object-oriented - or

[sqlite] Extra sqlite DB file

2007-08-09 Thread Ken
Whilst running a transaction I noticed the following files were created for a sqlite database. What is the last file? How is it used? -rw-r--r-- 1 ixion users 6193152 2007-08-09 18:40 bat_412.db -rw-r--r-- 1 ixion users 11304 2007-08-09 18:40 bat_412.db-journal -rw-r--r-- 1 ixion users

Re: [sqlite] Extra sqlite DB file

2007-08-09 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > Whilst running a transaction I noticed the following files were created for > a sqlite database. > What is the last file? How is it used? > > -rw-r--r-- 1 ixion users 6193152 2007-08-09 18:40 bat_412.db > -rw-r--r-- 1 ixion users 11304 2007-08-09 18:40

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
Igor I tried your solution and can't get it working . Here is my code. The STRANGE problem that I am having is that when it adds to the vector at position 1, the vector contains the object. But when it adds to vector at position 2 using push_back - for some reason the contents

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
Thanks I guess i have to figure out how to use prepared statements instead of callbacks because i can't get callbacks working as expected. Dennis Cote <[EMAIL PROTECTED]> wrote: Stephen Sutherland wrote: > Hi > > I am using the 'quick start' C-styled code for sqlite3 >

RE: [sqlite] [Visual Basic] How do you work with SQLite?

2007-08-09 Thread mos
At 05:25 PM 8/9/2007, you wrote: I use it mainly to manipulate data obtained from an Interbase database. All the data will eventually be dumped to Excel. I use 2 ways to move data from Interbase to SQLite. One, via an ADO recordset after connecting to Interbase with ODBC. This recordset will

Re: [sqlite] Proposed incompatible change to SQLite

2007-08-09 Thread Andrew Finkenstadt
On 8/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > We propose to modify this so > that these routines work across all database > connections in the same process. > > Double plus good for us.

[sqlite] Threading issues in SQLite

2007-08-09 Thread Bharath Booshan L
Hello All, I am using SQLite in one my application and I require to retrieve around 4-5 sets of information simultaneously. I have opted to run the queries in separate threads which seems obvious choice here. However, I came to know from one of the documents in sqlite.org that single

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Igor Mironchick
I think problem is in use char * as parameter in push function. For that reason I use std::string always. Look, in callback2 SQLite pass char ** - array of char*. But when your code leave callback2 SQLite might errase that array and then all char* will garbage. But when in push method you will

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
okay i'm trying to use preparestatement and step and finalize. I have some quick questions about this legacy.c code. First I notice that it has a while loop within a while loop. Question: when I implement this prepared statement, will I also need a while loop within a while loop ?