GGcpp
Programmer
- Nov 21, 2007
- 2
Hope I finally got the right forum 
I have this SQL problem. I’m a C++ guy who's database experience is limited to basic Select commands. I boasted this should be easy but realized how long ago I did any 'real' SQL commands. I know this is easy stuff for the gurus
Note, I am under Access (MDB) usually do stuff in C++ (one row at a time) but I know this is easy and hope to learn something.
I need to update a table (user) with data contained in another table (latest user info)
Here is my problem in ‘C’ like pseudo-code:

I have this SQL problem. I’m a C++ guy who's database experience is limited to basic Select commands. I boasted this should be easy but realized how long ago I did any 'real' SQL commands. I know this is easy stuff for the gurus

Note, I am under Access (MDB) usually do stuff in C++ (one row at a time) but I know this is easy and hope to learn something.
I need to update a table (user) with data contained in another table (latest user info)
Here is my problem in ‘C’ like pseudo-code:
Code:
//I have 2 similar tables, ‘Master’ and ‘Updates’
// Step 1: update / merge (join?)
if (Master.numberId == Updates.MasterNumber)
{
Master.total_global = Updates.tglobal
Master.ACTION_text += Updates.ACTION_text
Master.fact = Updates.fact
}
Code:
// Step 2: add new entries
if(Updates.MasterNumber ‘is not in’ Master.numberId)
{
Insert into Master( field1, field2, field3, ...)
Select * from Updates where MasterNumber == Updates.MasterNumber
}