Verify 2 different tables

Verify 2 different tables

Postby Marc Venken » Sun May 28, 2017 8:02 am

Hello,

I want to check the content of 2 tables.
1. is a downloaded csv that is converted to dbf (working lokal)
2. is a Mariasql database

The fieldnames in both tables are not the same, but they contains the same data.

I can make a Xbrowse, with a new structure and have both data into it like :

ID is the link between the two files

ID, Member_1, Member_2, Name_1,Name_2,adres_1,adres_2,....

and fill with two loops each field. Than I can compare easy in a Xbrowse like

if upper(name_1) <> upper(naam_2) Color the line to show there is a difference. This can be done for all fields.

Do you have better solutions for this kind of work ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Verify 2 different tables

Postby James Bott » Sun May 28, 2017 7:49 pm

Marc,

Do you have better solutions for this kind of work ?


That is hard to say without knowing more about why you are doing this comparison.

Are you going to manually make corrections to one of the databases? If so, why is this needed, and could it be automated to just show the errors? Or, better could it automatically fix the errors?

Are you looking for evidence of programming errors? If so, wouldn't a report just showing the conflicts be better?

Any other information that might help?

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Verify 2 different tables

Postby Marc Venken » Sun May 28, 2017 10:31 pm

James,

The CSV file that becomes one of the databases is a download of the official site where every soccer club has to be member of. This data can only be changed from there software, and only by one person who represent our club.
Remember !! Only 1 person can change this data online with a hardware key and software passwords.

The second database is mine, and original based on the very first download of the csv file.

Now, during a season, coached and members of our club with previleges can and will change data of there own team. We have 18 team, and also 18 coaches that can change data if needed.
data like, Adres, cellphone, emails, . They have a login only for there own team.

So, Afther a while, we have a database with the latest info, and this is what I want to compare with the online data of the csv file.
I only will show in a xbrowse with data is changed between the original csv and my updated database. With these changes, the person who has the hardware key can change the online data.
Remember, this person with the hardware key never knows if data is changed by the others, unless I give him the difference.

BTW : I have this setup running now.
My solution :

Create a new database with all fields needed to compare (index on id = same for both)
Read the csv file and fill the data
read the second data and fill
Show a Xbrowse with colors where the data is not the same.
This data has to be manualy changed in the offical online database. No other options here.

I only think that I use many extra lines of code to do what people here do short :wink:

Thanks...
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Verify 2 different tables

Postby James Bott » Mon May 29, 2017 3:48 pm

Marc,

First let me say that this is a nightmare senario. The best solution is to prevent the problem from ocurring in the first place.

When you say "online" do you mean the database is accessable via the internet? If so, they why isn't everyone using the same database? Then you wouldn't have the problem.

Remember, this person with the hardware key never knows if data is changed by the others, unless I give him the difference.


Is all this data being kept up with a FWH application? If so, why don't you just modify it to keep a logfile of every change made. Then you could just email the list to the person maintaining the main database.


BTW : I have this setup running now.
My solution :

Create a new database with all fields needed to compare (index on id = same for both)
Read the csv file and fill the data
read the second data and fill
Show a Xbrowse with colors where the data is not the same.


My question is, then what? How is this going to help get the changes into the master database?

This data has to be manualy changed in the offical online database. No other options here.


Why aren't there any other options?

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Verify 2 different tables

Postby Marc Venken » Tue May 30, 2017 10:03 pm

When you say "online" do you mean the database is accessable via the internet? If so, they why isn't everyone using the same database? Then you wouldn't have the problem.


I Explaine : The online database is from the Belgium Football federation. Only 1 person for each club has access to it. We are a member of this federation and all our players are member of it.
I made a FWH program to maintain member data changes, but more extra data for our own club.

These changes need to be updated to the online database of the federation.

Is all this data being kept up with a FWH application? If so, why don't you just modify it to keep a logfile of every change made. Then you could just email the list to the person maintaining the main database.


This is more of less the idea. In the browse the differences are automatic shown, and the person who has access to the federation can update the data.

Why aren't there any other options?


The federation does not alow any other way of changing data.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Verify 2 different tables

Postby James Bott » Tue May 30, 2017 10:52 pm

Marc,

OK, I see.

This is more of less the idea. In the browse the differences are automatic shown, and the person who has access to the federation can update the data.


So, I am guessing that this person will have a copy of the two databases, and the FW program on a laptop and will also be able to access the master database at the same time?

If so, it seems it would still be better to have a list of changes. Something like the name of the player and the field or fields that need changing. This would be in a report format (paper or electronic). Something like:

John Smith
Street: 2113 Main St
Phone: ,,,,
etc...

I would think that scrolling back and forth across a long line of data looking for differences would be much harder to use.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Verify 2 different tables

Postby Marc Venken » Tue May 30, 2017 11:00 pm

I would think that scrolling back and forth across a long line of data looking for differences would be much harder to use.


Yes, therefore I present his a Xabrowse with only changed records and color the differences on every row.

Thanks for thinking with me ...
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 51 guests