Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Reported for Version 2.03 » View Incident Report |
Serious |
Reported By: James Relyea Reported On: 11/17/2009 For: Version 2.03 Build 6 |
SCRIPT BEGIN declare cur cursor without return for selCur; declare sql statement; declare sqlUpdate statement; declare idGuid guid ; declare intOldId int; --update the corp ids prepare selCur from 'SELECT tCorps.idCorpID, tCorps.zzCorpId FROM tCorps INNER JOIN tCorps_tContacts_XRef ON tCorps.zzCorpId = tCorps_tContacts_XRef.zzCorpId'; start transaction on tables tCorps_tContacts_XRef; begin open cur; fetch first from cur (idCorpID,zzCorpId) into idGuid,intOldId; while not eof(cur) do prepare sqlUpdate from 'update tCorps_tContacts_XRef set idCorpId=? where zzCorpId=?'; execute sqlUpdate using idGuid,intOldId; fetch next from cur (idCorpID,zzCorpId) into idGuid,intOldId; end while; --corp ids updated --update the dept ids close cur; unprepare selCur; unprepare sqlUpdate; prepare selCur from 'SELECT tDepts.idDeptId, tDepts.zzCorpDeptId FROM tCorps_tContacts_XRef INNER JOIN tDepts ON tCorps_tContacts_XRef.zzDeptId = tDepts.zzCorpDeptId'; open cur; fetch first from cur (idDeptId,zzCorpDeptId) into idGuid,intOldId; while not eof(cur) do prepare sqlUpdate from 'update tCorps_tContacts_XRef set idDeptId=? where zzDeptId=?'; execute sqlUpdate using idGuid,intOldId; fetch next from cur (idDeptId,zzCorpDeptId) into idGuid,intOldId; end while; --deptd ids updated --update the contact ids close cur; unprepare selCur; unprepare sqlUpdate; prepare selCur from 'SELECT tContacts.idContactId, tContacts.zzContactId FROM tCorps_tContacts_XRef INNER JOIN tContacts ON tCorps_tContacts_XRef.zzContactId = tContacts.zzContactId'; open cur; fetch first from cur (idContactId,zzContactId) into idGuid,intOldId; while not eof(cur) do prepare sqlUpdate from 'update tCorps_tContacts_XRef set idContactId=? where zzContactId=?'; execute sqlUpdate using idGuid,intOldId; fetch next from cur (idContactId,zzContactId) into idGuid,intOldId; end while; --contact ids updated commit; exception rollback; raise; end; END
This web page was last updated on Wednesday, March 20, 2024 at 07:22 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |