Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL procedure to compare table of records with database table

user5108636Dec 13 2016 — edited Dec 19 2016

Hi All,

    My requirement is to compare a table of records with actual data in a table say, 'employee'

How will I compare data in table of records with actual table data for any updates and return the delta or changes.

I have written a skeleton procedure.

TABLE OF EMPLOYEES%ROWTYPE INDEX BY PLS_INTEGER;

PROCEDURE calculate_emp_delta(emp_in employees, emp_delta OUT employees)

   IS

    CURSOR c_employees

    IS

       SELECT re.first_name,

              re.second_name,

              re.position_number,

              re.position_start_date

         FROM employees re;

    cr_employee             c_employees%ROWTYPE;

   BEGIN

--Code to be added.

   null;

   END;

How to compare emp_in and what is available in the cursor and return the delta. Please advise.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2017
Added on Dec 13 2016
14 comments
1,846 views