|
-
Very cool!
Here is the final code:
DECLARE
___-- ---------------
___-- Local Variables
___-- ---------------
___l_Employee_ID1______EmployeeSalaryHistory_P.Employee_ID_TYPE___;
___l_Employee_ID2______EmployeeSalaryHistory_P.Employee_ID_TYPE___;
___l_idx1____________PLS_INTEGER;
___l_idx2____________PLS_INTEGER;
BEGIN
______-- First, get the unique entries
___FOR x IN 1..EmployeeSalaryHistory_P.g_Old_Employee_ID.COUNT
___LOOP
______l_Employee_ID1(EmployeeSalaryHistory_P.g_Old_Employee_ID(x)) := EmployeeSalaryHistory_P.g_Old_Employee_ID(x);
___END LOOP;
___l_idx1___:=___l_Employee_ID1.FIRST;
___l_idx2___:=___0;
___WHILE l_idx1 IS NOT NULL
___LOOP
______l_idx2__________________:=___l_idx2 + 1;
______l_Employee_ID2(l_idx2)___:=___l_Employee_ID1(l_idx1);
______l_idx1__________________:=___l_Employee_ID1.NEXT(l_idx1);
___END LOOP;
______-- Loop through each deleted entry and handle the changes
___FORALL x IN l_Employee_ID2.FIRST..l_Employee_ID2.LAST
After putting the distinct values into l_Employee_ID1, I needed to re-create a contiguous array with l_Employee_ID2 so the FORALL would work - doesn't work on sparse tables.
I think I'm going to make a generic proc for this - it is very cool (I'm such a geek )
Thanks a ton!
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|