AllExperts > Ingres 
Search      
Ingres
Volunteer
Answers to thousands of questions
 Home · More Ingres Questions · Answer Library  · Encyclopedia ·
More Ingres Answers
Question Library

Ask a question about Ingres
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jean-Pierre Zuate
Expertise
Any questions about database Ingres (owned by Computer Associates then Ingres Corp) : - Ingres 6.4 - OpenINGRES from 1.0 to 2.0 - IngresII from 2.0 to 2.6 - Ingres R3, Ingres 2006 (Open Source version) - All tool around Ingres : ABF, Report Writer, Replicator, OpenROAD (3.5 to 2006), Ingres/NET Ingres/STAR, ...

Experience
16 years of computing experience as :
- AS400 programmer
- AIX / Ingres administrator and developer (OpenROAD and korn shell)
- Ingres DataBase Administrator
- Ingres expert - Data modelisation - ETL - Reporting - Many of Computer Associates sofwares - ITIL / CMDB / Change Management

Organizations
http://lafageconseil.fr

 
   

You are here:  Experts > Computing/Technology > Databases > Ingres > Compare two tables/sql results from two different databases

Ingres - Compare two tables/sql results from two different databases


Expert: Jean-Pierre Zuate - 1/17/2009

Question
Hello Jean-Pierre,

I'm newbie to Ingress and I've come across an interesting assignment in my company.

I need to compare two tables or SQL output of two tables in Ingress DB. These two tables are same tables but on different databases (same schema) and on different machines..

Which means I need to compare the SQL results from the main table with the backup table in Ingress. I know one way to do this is to store the results in two seperate files and then compare these files to find out the difference.

But I could not come across any syntax to store the SQL results in file in Ingress. Please note that these table are huge ones and it may not right to store the entire table in flat/.txt files. so not sure if copydb will work here.

Kindly can I please request you to guide me here. It will be a huge help for me. Thanking you in advance,

with warm regards,
- Avadhut

Answer
Hello,

First, thank you for your interest about Ingres.

Yes copydb can help you in this case. The table volume will impact only on the time to read data and the final file size. This method will work for sure, even if it is not, from a database point of view, the most "elegant".

If your tables are huge, it will possibly preferable to compare them via os command, thru files.

You can use copydb with 2 options in your cases :
-c to unload data in an ASCII format (ie readable by human)
use a vnode to address the remote database (vnode::dbname)

You can also try to create a star database (federate database), and then point to each of your tables. Ingres Star did not care about remote or not cause it always use vnode to adress a database (local or remote). But ... Ingres/Star need some binaries to be installed and configured, and here again I'am not sure, if your tables are huge, the consuming time to compare them will be huge too.

Hope this reply help you. Do not hesitate to ask more if you need some clarifications.

Best regards,
Jean-Pierre ZUATE
http://lafageconseil.fr

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.