Hi Juan!

People give you a several advices about alternative solutions. But I try
to get back to your original question ("¿how to do, in the best way, the
new phase 2?")

I suppose that database structure isn't changed and we're talking about
tracking data differences only. I also suppose that your remote
customers use your database just as a some kind of dictionary - they do
not change data, only read them. Am I right? 

So, my proposed solution is:
1. I use an external programming language, not only SQLite. In my
environment it is LuaSQLite, LUA scripting language with interface to
SQLite. Surely, you may choose something you like. 2. For every table
I'll add a autoincrement integer to have an obvious ID (if table already
do not have one, of course :) ). 3. Export all table data to text and
create diff-file with any text-analysing tool (my choice is Lua too) or 
3a. Or open both databases and do it on the fly, as you wish Having a
unique record id created in (2) will help you perform step (3) by very
evident way
* bonus if you are using Lua too :) . I can send to you my code [export
sqltable to CSV-file] as a working sample :)

On customer side action when receive a diff-file will be:
1. Execute (LuaSqlite3) importing-tool, who will convert your entries
("+column1=value1;column2=value2") to something like 'INSERT OR REPLACE
...'
("-column1=value2;column2=value4") to sometjing like DELETE FROM tbl
WHERE .... 2. Wrap these inserts/deletes with BEGIN/END transaction,
execute command.

This way may be is not optimal but it is so clear, and after you realize
that there's a many point of future optimization. But if you implement
it you will start your idea from the dead point, get some result in
short time. I think it is important to see how big your diffile will be.

Hope it helps!

WBR, Denis.

-----Original Message-----
From: Juan Perez [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 04, 2006 9:17 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Best way to compare two databases


(excuse me for the other mail, i clicked accidentally the button...)

Hi:

 I think that i explained me bad.
 In my work i do next until now:

 Phase 1: I generate automatically a database from a CRM
 Phase 2: I put the database in the FTP for the commercials of the
enterprise. They are located in different parts of the country.  Phase
2: The commercials uses my applicaction with the database to work.

The problem is that now, the datasase is too big (and we pay the FTP to
an ISP for the used size and the consumed wide of band). So, i now want
to change the process to:

 Phase 1: I generate automatically a database from a CRM
  Phase 2: As I already have the previous database, i will generate a
diff file in the format i explained in the previous mail.  Phase 3: I
put the little diff file in the FTP ant the commercials downloades it..
Phase 4: The commercials brings up to date the database using my
application (it needs to be changed to do it).  Phase 5: The commercials
can use my applicaction with the new database to work.

So, the question is ¿how to do, in the best way, the new phase 2?



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to