Solved

Access Database-Update Query Error - Cannot Update

Posted on 2014-01-15
2
147 Views
Last Modified: 2014-03-21
I have been having problems with what I thought was an  easy update query, using the following query, and the error prompt simply says it cannot update database.  I have tested this code many times trying to run an update query to replace existing staging table values with mapped values.  Appreciate it if anyone can help.

The SQL Code is as follows:

UPDATE stgOutcomeDataUpload
SET stgOutcomeDataUpload.SPassABC = (SELECT  lkpStage4FieldMappings.FieldValue
FROM  lkpStage4FieldMappings, stgOutcomeDataUpload
WHERE stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldString AND (((lkpStage4FieldMappings.FieldName)="SPassABC")));


thanks
0
Comment
Question by:yasanthax
2 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 150 total points
ID: 39783997
Your query is incorrect. Try this one:
UPDATE stgOutcomeDataUpload  
INNER JOIN lkpStage4FieldMappings 
ON stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldString 
SET stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldValue
WHERE lkpStage4FieldMappings.FieldName="SPassABC";

Open in new window

0
 

Author Comment

by:yasanthax
ID: 39792406
Sorry for the late response.  This works.  May thanks.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now