473,412 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Update in tables with joins.

3
I'm trying to update an empty field in a table using the update statment. The table has a number of joins and the update statement comes up with an error when I enter the main table to update. should i be including the joins here as well? I get the following error:

Server: Msg 208, Level 16, State 1, Line 178
Invalid object name 'TD_EXTRACT'.
Server: Msg 208, Level 16, State 1, Line 178
Invalid object name '#Neil.Mortgage'.

The code im using...

DECLARE Alpen_Cursor CURSOR FOR

SELECT TDE.Merged_Fund_Desc,
TDE.MORTGAGE,
TDE.Client_Main_Surname,
HAT.[Last_Delq_Bucket],
HAT.[Current_Balance],
HAT.[Possession_Date],
M56.ASSNAM AS [Possession Agent],
TDP.REGION,
HAT.Litigation_Status,
HAT.MORTGAGE_STATUS,
A34SC.PROGCLOSE,
Cast('space' AS VARCHAR(100)) AS Prog_Point_list


FROM REPT_SOURCE_ME_01.dbo.TD_EXTRACT TDE

INNER JOIN REPT_SOURCE_ME_01.dbo.TD_ARREARS HAT
ON TDE.MORTGAGE = HAT.MORTGAGE

INNER JOIN REPT_SOURCE_ME_01.dbo.[ACM41] ACM
ON TDE.MORTGAGE = ACM.MORTGAGE

INNER JOIN REPT_SOURCE_ME_01.dbo.[MAM56] M56
ON ACM.LITPOSSAGENT = M56.ASSCDE

INNER JOIN REPT_SOURCE.dbo.[ACT34StageC] A34SC
ON ACM.MORTGAGE = A34SC.MORTGAGE

INNER JOIN REPT_SOURCE.dbo.[MAM16] M16
ON ACM.LITSOLICITOR = M16.SOLCDE

INNER JOIN REPT_SOURCE_ME_01.dbo.TD_PROPERTY TDP
ON TDE.MORTGAGE_NO = TDP.MORTGAGE_NO

WHERE A34SC.PROGPNT IN ('AUC','AUO','MPS','NRC','OLP','ORC','POS','RAR',' RCO','REC','RMP','ROF','ROS','ROW','RPO','TIC','VP O')
AND HAT.Litigation_Status = 'possession'
AND HAT.MORTGAGE_STATUS = 'live'
AND A34SC.PROGCLOSE IS Null


GROUP BY TDE.Merged_fund_Desc,
TDE.MORTGAGE,
TDE.Client_Main_Surname,
HAT.[Last_Delq_Bucket],
HAT.[Current_Balance],
HAT.[Possession_Date],
M56.ASSNAM,
TDP.REGION,
M16.SOLNAME,
HAT.Litigation_Status,
HAT.Mortgage_Status,
A34SC.PROGCLOSE,
ACM.LITSOLICITOR

HAVING (((HAT.Litigation_Status) = 'Possession') AND ((HAT.MORTGAGE_STATUS) = 'Live') AND ((A34SC.PROGCLOSE) IS Null));

OPEN Alpen_Cursor
FETCH NEXT FROM Alpen_Cursor

CLOSE Alpen_cursor
DEALLOCATE alpen_cursor

UPDATE
SET TD_EXTRACT.Prog_Point_list = #neil.PROGPNT + ','
FROM TD_Extract

INNER JOIN #Neil.Mortgage
ON TD_Extract.Mortgage = #Neil.Mortgage
AND #Neil.PROGPNT = Alpen_Cursor.PROGPNT
Aug 17 '05 #1
0 4014

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

Similar topics

2
by: serge | last post by:
/* This is a long post. You can paste the whole message in the SQL Query Analyzer. I have a scenario where there are records with values pointing to wrong records and I need to fix them using an...
5
by: Harry Broomhall | last post by:
I wonder if anybody could give me a few pointers on a problem I face. I need to do an UPDATE on table A, from an effective left outer join on A and another table B. (This is trying to perform a...
2
by: Pete | last post by:
After realizing the integrity of my data is questionable I went back to my update queries and opened up a few. The joins I had originally created between key fields were no longer there. It was...
11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
3
by: Chris Morton | last post by:
Not sure if this is the right location for this question. I Saw several previous FP questions in this Group and did not see one for VFP.... If this is the wrong group, please direct me...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
5
by: Bogdan | last post by:
Hi, I have a stored procedure that uses JOINs to return columns from multiple tables. I also have another stored proc that that takes a series of params and updates multiple tables. I used the...
8
geolemon
by: geolemon | last post by:
I'm trying to perform an update, and I can't avoid this error - I've tried this query what must be 5 different very fundamentally different ways now. Arg. I used to be a DBA in large DB2 and SQL...
3
by: modernshoggoth | last post by:
G'day all, I'm trying to update a single table (containing plans for flights) with information from the same and other tables (containing info for organisations and locations). tblFlightPlans...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.