b1nary0mega
9/15/2014 - 7:11 PM

Update an employee's evaluation to a different year; will update regular and NP evaluations.

Update an employee's evaluation to a different year; will update regular and NP evaluations.

/* NAME: Update Employee Evaluation Pages.sql
 * DESC: This script will update an employee's evaluation to a different year;
 *       Will update regular OR nurse practicioner evals. 
 * DATE: 04-08-2014
 */

DEFINE emplID = '123456';
DEFINE evalLV = '01NN';
DEFINE oldEvalYR = '2013-6-Month';
DEFINE newEvalYR = '2013-Annual';

--UPDATE EVAL_EMPL_PR
update (
select *
from eval_empl_pr
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG01
update (
select *
from eval_pg01
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG02
update (
select *
from eval_pg02
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG03
update (
select *
from eval_pg03
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG04
update (
select *
from eval_pg04
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG05
update (
select *
from eval_pg05
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG06
update (
select *
from eval_pg06
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG07
update (
select *
from eval_pg07
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG08
update (
select *
from eval_pg08
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG09
update (
select *
from eval_pg09
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG10
update (
select *
from eval_pg10
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';

--UPDATE EVAL PG12
update (
select *
from eval_pg12
where empl_id='&emplID'
and year = '&oldEvalYR'
) set year = '&newEvalYR';

--UPDATE EVAL PG13
update (
select *
from eval_pg13
where empl_id='&emplID'
and year = '&oldEvalYR'
) set year = '&newEvalYR';
commit;

--UPDATE NP EVAL SCORE DATA
update (
select *
from NPEVAL_SCORE_DATA
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';
commit;

--UPDATE NP EVAL SEC2 DATA
update (
select *
from NPEVAL_SEC2_DATA
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';
commit;

--UPDATE NP EVAL SEC3 DATA
update (
select *
from NPEVAL_SEC3_DATA
where empl_id='&emplID'
and year = '&oldEvalYR'
and eval_level = '&evalLV'
) set year = '&newEvalYR';
commit;