If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Exporting to excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-06-04, 06:39
Rohitchitre Rohitchitre is offline
Registered User
 
Join Date: Sep 2004
Posts: 15
Smile Exporting to excel

Hi,

I have VB 6.0 application which accepts two database tables and compares the data in those tables.(Compares col. by Col.). Then it emphasises the changes with different colors i.e Modification - Yellow ,Addition - Red ,- Deletion Blue etc.

I have given one option to export the data to MS - Excel. The out put required to the Excel File is One record from Source table and Second one from Destination file / table (So that it would be easy to understand the comparison between two records).I have one column common to both the tables.Using this column i compare the records and emboss with color codes.

But when i export to Excel i select first ID (which is common)
export the record from source file then get record with the same id from desitination file and export that to the next line. But for say, 10000 records it takes a lot of time.
Do anyone have the solution?

Thanks & regards
Rohit
Reply With Quote
  #2 (permalink)  
Old 09-06-04, 12:13
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
This sounds like a poster child problem for a FULL OUTER JOIN to me.

-PatP
Reply With Quote
  #3 (permalink)  
Old 09-08-04, 02:06
Rohitchitre Rohitchitre is offline
Registered User
 
Join Date: Sep 2004
Posts: 15
Not Exactly! bacause I am exporting only the rows which are matching from both the tables.

Now i want to export to the excel
e.g.
Row1 - Headings
Row2 - Record from Table1
Row3 - Record from Table2 with same ID
Row4 - Next Record from Table1
Row5 - Record from Table2 ....

If I go one by one, definitely it is going to take chunk of time!
Don't know whether there is any altrnative available for this!
Reply With Quote
  #4 (permalink)  
Old 09-08-04, 03:38
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
What you really want is a FULL OUTER JOIN. Let the VB app handle creating the spreadsheet from the result set (making two rows in the app's output from one row of the query's output) and let the SQL Server do the "heavy lifting" of the data for you.

There is a disconnect between your query and your desired output, but the client side code in the VB app can handle that disconnect nicely!

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On