b1nary0mega
5/20/2014 - 7:07 PM

Update all the necessary tables for an employee's IER when they go from one Hospital to the other (i.e. Strong --> Highland)

Update all the necessary tables for an employee's IER when they go from one Hospital to the other (i.e. Strong --> Highland)

/* TITLE: updateIERemployeeID.sql
 * AUTH: James R. Aylesworth
 * DATE: May 20, 2014
 * DESC: This will update all the necessary tables for an employee's IER when
 *       they go from one Hospital to the other (i.e. Strong --> Highland)
 */
 
DEFINE oldEmplID = '123456';
DEFINE newEmplID = '987654';

update ier_certifications 
set ier_certifications.employee_id = '&newEmplID'
where ier_certifications.employee_id = '&oldEmplID';

update ier_community 
set ier_community.employee_id = '&newEmplID'
where ier_community.employee_id = '&oldEmplID';

update ier_courses 
set ier_courses.employee_id = '&newEmplID'
where ier_courses.employee_id = '&oldEmplID';

update ier_degree 
set ier_degree.employee_id = '&newEmplID'
where ier_degree.employee_id = '&oldEmplID';

update ier_honors 
set ier_honors.employee_id = '&newEmplID'
where ier_honors.employee_id = '&oldEmplID';

update ier_inservice 
set ier_inservice.employee_id = '&newEmplID'
where ier_inservice.employee_id = '&oldEmplID';

update ier_life_certs 
set ier_life_certs.employee_id = '&newEmplID'
where ier_life_certs.employee_id = '&oldEmplID';

update ier_organizations 
set ier_organizations.employee_id = '&newEmplID'
where ier_organizations.employee_id = '&oldEmplID';

update ier_presentations 
set ier_presentations.employee_id = '&newEmplID'
where ier_presentations.employee_id = '&oldEmplID';

update ier_teams 
set ier_teams.employee_id = '&newEmplID'
where ier_teams.employee_id = '&oldEmplID';