473,382 Members | 1,689 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,382 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 4012

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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.