1 Reply Latest reply: Feb 13, 2014 9:54 AM by Vinayaka Prabhu RSS

    How to end date for course in OLM Oracle APPS

    Narendra

      Dear Gurus,

       

      I need to end date for courses, i developed script.

      whether is this correct, pls confirm me..

      ======================================

      declare

      v_version_id number := '4036';

      cursor c1 is select oe.event_id,

             oe.vendor_id,

             oe.object_version_number,

             oof.offering_id,

             oav.activity_version_id,

             oof.object_version_number offering_object_version,

             oav.object_version_number course_object_version

      from   ota_events oe,

             ota_offerings oof,

             ota_activity_versions oav

      where  oe.parent_offering_id = oof.offering_id

      and    oof.activity_version_id = oav.activity_version_id

      and    oav.activity_version_id = v_version_id;

       

      begin

       

           for i in c1 loop

           if i.activity_version_id = v_version_id then

          

           APPS.ota_event_api.update_class   

              (p_event_id  => i.event_id,

               p_effective_date => sysdate,

               p_vendor_id => i.vendor_id ,

               p_object_version_number => i.object_version_number,

               p_course_end_date => sysdate);

           dbms_output.put_line('Record updated sucessfully for classess');

         

               apps.OTA_OFFERING_API.Update_offering

                (

                 p_effective_date               => sysdate

                ,p_offering_id                  => i.offering_id

                ,p_object_version_number        => i.offering_object_version

                ,p_activity_version_id          => i.activity_version_id

                ,p_end_date                     => sysdate);

                  

             dbms_output.put_line('Record updated sucessfully for offerings');

            

             ota_activity_version_api.Update_activity_version(

                p_effective_date               => sysdate ,

                p_activity_version_id          => i.activity_version_id,

                p_object_version_number        => i.course_object_version,

                p_end_date                     =>  sysdate

                );

              dbms_output.put_line('Record updated sucessfully for courses');

             else

             dbms_output.put_line('Version id not exits');

             end if;

           end loop;

        commit;

            exception

            when too_many_rows then

            dbms_output.put_line('two many rows');

            when no_data_found then

             dbms_output.put_line('no records found'); 

           when others then

           dbms_output.put_line('error occured while updating records');          

      end;

       

       

      Thanks in advance,

      - Naren