Hi
I have a procedure to which I am getting 2 rows from the same table as in parameters.
Within the procedure I have a VARRAY holding specific column names of the same table as strings. This collection is defined in another package as I want that list to be globally available right across the instance.
The requirement is that I want to compare only the columns of the 2 rows available in the collection. If any are different then I need to do something.
PROCEDURE upd (ip_old test_table%ROWTYPE
,ip_new test_table%ROWTYPE) IS
lr_column_list global_pkg.column_match := global_pkg.SERVICE_EVENTS_LIST; -- this declares and initializes a varray lr_column_list with a list of column names
lr_update_required BOOLEAN := FALSE;
BEGIN
FOR i IN 1..lr_column_list.COUNT LOOP
-- I need to iterate through this and compare the values of similarly named columns between the old and new rows
-- and if matching make lr_update_require := TRUE
END LOOP;
IF lr_update_required = TRUE THEN
-- DO SOMETHING
END IF
END upd;
Any ideas how I can do this comparison? I have been dynamic sql land and back with no luck!
Thanks very much for your expertise.
Edited by: Fouwaaz on Sep 28, 2012 9:42 AM