Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update not working

Status
Not open for further replies.

nakkii

Programmer
Jul 11, 2002
38
US
I have two tables Loaninfo and Loaninfo_temp, I want to update rows in the Loaninfo table with the values in Loaninfo_temp.

Here is my update statement:

Update LoanInfo Set
Loaninfo.Broker1 = Loaninfo_temp.Broker1,
Loaninfo.Broker2 = Loaninfo_temp.Broker2,
Loaninfo.Broker2City = Loaninfo_temp.Broker2City,
Loaninfo.Broker2Email = Loaninfo_temp.Broker2Email,
Loaninfo.Broker2Fax = Loaninfo_temp.Broker2Fax,
Loaninfo.Broker2Firm = Loaninfo_temp.Broker2Firm,
Loaninfo.Broker2MailAddr = Loaninfo_temp.Broker2MailAddr,
Loaninfo.Broker2No = Loaninfo_temp.Broker2No,
Loaninfo.Broker2Phone = Loaninfo_temp.Broker2Phone,
Loaninfo.Broker2StAddr = Loaninfo_temp.Broker2StAddr,
Loaninfo.Broker2State = Loaninfo_temp.Broker2State,
Loaninfo.Broker2Zip = Loaninfo_temp.Broker2Zip,
.
.
.
Loaninfo.WhoCutsChecks = Loaninfo_temp.WhoCutsChecks,
Loaninfo.ZipCode = Loaninfo_temp.ZipCode
Where Loaninfo.LoanRefNum = Loaninfo_temp.LoanRefNum AND Loaninfo.LoanRefNum = 1


Needless to say SQL throws-up all over this. What am I missing.

Thanks in advance for any help.
 
u r missing the table names
----------------------------
Update LoanInfo Set
Loaninfo.Broker1 = Loaninfo_temp.Broker1,
Loaninfo.Broker2 = Loaninfo_temp.Broker2,
Loaninfo.Broker2City = Loaninfo_temp.Broker2City,
Loaninfo.Broker2Email = Loaninfo_temp.Broker2Email,
Loaninfo.Broker2Fax = Loaninfo_temp.Broker2Fax,
Loaninfo.Broker2Firm = Loaninfo_temp.Broker2Firm,
Loaninfo.Broker2MailAddr = Loaninfo_temp.Broker2MailAddr,
Loaninfo.Broker2No = Loaninfo_temp.Broker2No,
Loaninfo.Broker2Phone = Loaninfo_temp.Broker2Phone,
Loaninfo.Broker2StAddr = Loaninfo_temp.Broker2StAddr,
Loaninfo.Broker2State = Loaninfo_temp.Broker2State,
Loaninfo.Broker2Zip = Loaninfo_temp.Broker2Zip,
.
.
.
Loaninfo.WhoCutsChecks = Loaninfo_temp.WhoCutsChecks,
Loaninfo.ZipCode = Loaninfo_temp.ZipCode
from LoanInfo, LoanInfo_Temp
Where Loaninfo.LoanRefNum = Loaninfo_temp.LoanRefNum AND Loaninfo.LoanRefNum = 1
 
For future reference, I recommend posting the actual error message rather than the colorful "SQL throws-up all over this." It isn't descriptive of the error and is not helpful in problem solving. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top