594: --
595:
596:
597: -- ------------------------- get_upload_headers_status ------------------------
598: -- Description: Reads the status of the passed phase from the hr_du_upload_headers
599: -- table.
600: --
601: --
602: -- Input Parameters
621: l_phase_status VARCHAR2(30);
622:
623: CURSOR csr_status IS
624: SELECT status
625: FROM hr_du_upload_headers
626: WHERE (upload_header_id = p_upload_header_id);
627:
628: --
629: BEGIN
744: --
745: PROCEDURE update_uploads (p_new_status IN VARCHAR2, p_id IN NUMBER) IS
746: --
747: -- table is hr_du_uploads
748: -- parent of hr_du_upload_headers
749: -- child of (none)
750:
751: l_complete VARCHAR2(30);
752:
752:
753: -- search child table for all complete
754: CURSOR csr_child_table_complete IS
755: SELECT status
756: FROM hr_du_upload_headers
757: WHERE ((upload_id = p_id)
758: AND (status <> 'C'));
759:
760: --
827: PROCEDURE update_upload_lines (p_new_status IN VARCHAR2, p_id IN NUMBER) IS
828: --
829: -- table is hr_du_upload_lines
830: -- parent of n/a
831: -- child of hr_du_upload_headers
832:
833: l_parent_table_id NUMBER(9);
834:
835: -- find parent table id
876: --
877:
878: -- ------------------------- update_upload_headers ----------------------
879: -- Description: Updates the status of the upload header in the
880: -- hr_du_upload_headers table. If the status is to be set to C or E then
881: -- the update status is cascaded up to the parent phase. For a C,
882: -- the status of all the child rows in the hr_du_upload_lines are
883: -- checked.
884: --
895:
896: --
897: PROCEDURE update_upload_headers (p_new_status IN VARCHAR2, p_id IN NUMBER) IS
898: --
899: -- table is hr_du_upload_headers
900: -- parent of hr_du_upload_lines
901: -- child of hr_du_uploads
902:
903: l_parent_table_id NUMBER(9);
913:
914: -- find parent table id
915: CURSOR csr_parent_id IS
916: SELECT upload_id
917: FROM hr_du_upload_headers
918: WHERE upload_header_id = p_id;
919:
920: --
921: BEGIN
929:
930: -- non-complete
931: IF (l_new_status IN('S', 'NS', 'E')) THEN
932: -- update the status for this row
933: UPDATE hr_du_upload_headers
934: SET status = l_new_status
935: WHERE upload_header_id = p_id;
936: COMMIT;
937: END IF;
945:
946: IF (csr_child_table_complete%NOTFOUND) THEN
947: -- update the status for this row since no child rows
948: -- are incomplete
949: UPDATE hr_du_upload_headers
950: SET status = l_new_status
951: WHERE upload_header_id = p_id;
952: COMMIT;
953: ELSE