No cursors please! DB2 syntax varies from SQL Server.
Just because it took me an hour to find it....I wish the syntax would be the same...but they're not
UPDATE ASSESS_AUDIT A1
SET FIRST_NAME = (SELECT SUB_FIRST_NAME
FROM ORG_TREE O1
WHERE A1.EMPL_ID = O1.EMPL_ID)
WHERE FIRST_NAME = ' '
AND EXISTS (SELECT * FROM ORG_TREE O2
WHERE A1.EMPL_ID = O2.EMPL_ID);
UPDATE SS_FAMILY_TREE_MAP SFTM
SET ORG_NAME = ( SELECT SUBSTR(SOR.SS_ORG_NAME,1,25)
FROM SS_ORG_REL SOR
WHERE SFTM.SS_ORG_CD = SOR.SS_ORG_CD
AND SFTM.SS_STRUCTURE_NAME = SOR.STRUCTURE_NAME)
WHERE ORG_NAME IS NULL OR ORG_NAME = ' '
What did YOU do! I lost All MY Work!
Sound familiar? I always love it when they blame the database. User or Developer, it doesn't matter, you and the database will ALWAYS be the first one to be blamed. Facts/smacts, they lost their data, and it's all your fault.
When you hit them square between the eyes that either the manager themself, or and underling destroyed a weeks worth of work....well there's just that great feeling when you see it in their face the time the realization hits home.....knida like when an 80 ton diesel engineer and a VW bug dance...talk about...