SQL Update - Please Help - Urgent

Steve Kuchta

New Member
Hi everybody,

I am hoping somebody will have an answer for me. I have been getting the following error when trying to copy the contents of one field to the contents of another field. Both fields are in different tables. *************************************************
Error: Syntax error (7587) (State:37000, Native Code: FFFFB1DD)
*************************************************

The following are the sql statements themselves:
*************************************************
select PUB.JobHead.ProdCode, PUB.Part.ProdCode
from PUB.JobHead, PUB.Part
where PUB.JobHead.PartNum = PUB.Part.PartNum and PUB.JobHead.ProdCode <> PUB.Part.ProdCode
go

update PUB.JobHead
from PUB.JobHead, PUB.Part
set PUB.JobHead.ProdCode = PUB.Part.ProdCode
where PUB.JobHead.PartNum = PUB.Part.PartNum and PUB.JobHead.ProdCode <> PUB.Part.ProdCode
go
*************************************************

The select statement gives me exactly what I want but the error comes when I try to do the update. We are running Progress91D. I am thinking this code should work but I feel the error is coming in with the joining of the two tables. Can anyone out there help me?

I had already posted this and did not get any responses. I assumed nobody saw the first posting. Since time is running out I decided to post it again. I apologize if double-posting is against policy, but this is very important.

Thank you very much,

Steve Kuchta

 
Have you tried:

update PUB.JobHead, PUB.Part
set PUB.JobHead.ProdCode = PUB.Part.ProdCode
where PUB.JobHead.PartNum = PUB.Part.PartNum and PUB.JobHead.ProdCode <> PUB.Part.ProdCode
 
Yes, I have tried that. I think the problem is that the information is coming from two separate tables. I believe this requires a nested statement but I have not been able to get the right syntax down. The two tables are PUB.Part and PUB.JobHead. I am hoping that somebody will have the right format for an embedded statement.

Thank you very much for your help.

Steve
 
Back
Top