473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Update and append data in one table from data in another table

62 New Member
Hello -

I have a local table in my database called t_CompanyData that holds a subset of the fields in another table called dbo_INT_AUX_LISTING.

dbo_INT_AUX_LISTING is a linked table via an ODBC connection. This is a table in our CRM system and the data in that table is updated constantly.

I need to run a query to:
1 - update the data in t_CompanyData with any updated data for related records in dbo_INT_AUX_LISTING

2 - append any NEW records in dbo_INT_AUX_LISTING to t_CompanyData
I wrote an query that updates data and adds any new records using the strategy at
http://support.microsoft.com/kb/127977

New records are being added to t_CompanyData. However, the value in dbo_INT_AUX_LISTING.LISTING_ID field is not being added to t_CompanyData.IA_CompanyLISTING_ID.

I have verified that the LISTING_ID field in the dbo_INT_AUX_LISTING table is a NUMBER datatype (not autonumber). It is a primary key.

Expand|Select|Wrap|Line Numbers
  1. UPDATE (dbo_INT_AUX_LISTING LEFT JOIN t_CompanyData 
  2. ON dbo_INT_AUX_LISTING.LISTING_ID = t_CompanyData.IA_CompanyLISTING_ID) 
  3. LEFT JOIN dbo_INT_AUX_DIRECTORY 
  4. ON dbo_INT_AUX_LISTING.OWN_DIR_ID = dbo_INT_AUX_DIRECTORY.DIRECTORY_ID 
  5.  
  6. SET t_CompanyData.IA_CompanyLISTING_ID = [dbo_INT_AUX_LISTING].[Listing_ID], 
  7. t_CompanyData.COMPANY_NM = [dbo_INT_AUX_LISTING].[Company_NM],
  8. t_CompanyData.DIRECTORY_NM = [dbo_INT_AUX_Directory].[directory_NM];
  9.  
Any suggestions greatly appreciated.
Sandra
Jan 19 '12 #1
8 2426
NeoPa
32,556 Recognized Expert Moderator MVP
The settings of t_CompanyData.IA_CompanyLISTING_ID are of far more interest Sandra ;-) If this is an AutoNumber field for instance, it would fail.

PS Congrats on a well prepared question. Such quality from newbie posters is as rare as the proverbial R-H S.
Jan 20 '12 #2
Sandra Walsh
62 New Member
Thanks, NP ;)

t_CompanyData.IA_CompanyLISTING_ID is a number - long integer.

Any other clues I can send along?
Jan 20 '12 #3
NeoPa
32,556 Recognized Expert Moderator MVP
I'm grasping at straws here Sandra, but is it involved as a foreign index to another table maybe? Does it feature in the Relationships diagram?

Frankly I'm surprised at the described behaviour.
Jan 20 '12 #4
Sandra Walsh
62 New Member
dbo_INT_AUX_LISTING is not part of the Relationships diagram.

Here are a few images - hope this helps.





Jan 20 '12 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Why store the company name and directory name if they're already stored in the other tables? When you need them, you can just join the tables together.
Jan 20 '12 #6
Sandra Walsh
62 New Member
When I first set up this database it was taking a very long time to load the data from the ODBC tables. They have done some upgrades to our servers and now things are nice and fast.

I think it may be best for me to re-configure the back end to get data directly from the ODBC tables instead of going through this update/append process. Hopefully this wont be too much of a hassle :-)

Thanks all!
Jan 20 '12 #7
NeoPa
32,556 Recognized Expert Moderator MVP
I see the relationship, but I cannot think of anything that would explain the bahaviour. Even if all the restrictions are set up the value, by definition, must be a valid one as it's the same as the one it's linked to (having been copied from it). I don't know the problem I'm afraid.
Jan 20 '12 #8
Sandra Walsh
62 New Member
Thanks NP - maybe some issues with the install. I have been having other strange problems so I might re-install Access.
Jan 20 '12 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Deja User | last post by:
This is probably very simple but I can't figure out a way to update one table from another table. Here is an example: ------ TABLEA ------ first_name last_name
3
by: Yakimo | last post by:
Hi I am trying to append some records form tmpSource to tmpDest table using datasets Tables tmpSourec and tmpDest are identical. My setup is the following: - daSource - data adapter for...
1
by: Mike9900 | last post by:
What is the best way to copy DataRow from one table to another table, without copying its structure, which means copying only its data. -- Mike
1
by: thengfen | last post by:
Hi! Im having a problem in transfering a set of records from a table to another table. The scenario is when i select combo box (Course taken such as diploma in IT), then the process will...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
1
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
by: xoozlez | last post by:
Hi there, How do I insert new records from a dbo table to another table? This is what I have: 1 dbo_company 1 Member (table) I made a query in dbo_company with the criteria I only want to...
3
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are...
3
by: shubham rastogi | last post by:
hello guys I want to copy or insert records into the previously created table from another table.. For example I have two tables A and B .... I want to copy or insert records from table B into...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.