Jump to content
  • Advertisement
Sign in to follow this  
b3rs3rk

Help with ADO

This topic is 4182 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a small programm in C++ with ADO. Basically i'm trying to insert some tables from a DB in another DB. So i've started with something like this: INSERT INTO dest_table SELECT * FROM src_table IN "c:\src.mdb" Naturally, this works perfectly. But sometimes dest_table already has some records, so if i try to insert again those records (don't ask why, but it could happen) i get an error. What i need is a function that selects the record from src_table that aren't already in dest_table, something like (warning: veeeery pseudo-code :D ) INSERT IN dest_table SELECT * FROM src_table AND NOT IN dest_table Anyone can help?

Share this post


Link to post
Share on other sites
Advertisement
why not do this:

1.) Query target table for elements you are adding
2.) Remove any elements that already exist from your adding list
3.) Insert the unique elements into the table

Share this post


Link to post
Share on other sites
i've tryied something like this, creating a temporary table, copying the values and removing the duplicates with DELETE. After all i copied all the unique records in dest_table and used DROP to remove the temp table.

Works well, but the resulting DB is enormous! Seems that the temporary data (records and table) is not deleted, but only hided...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!