39: --
40: BEGIN
41: --
42:
43: hr_du_utility.message('ROUT','entry:hr_du_master.create_upload', 5);
44: hr_du_utility.message('PARA','(r_upload_data - record)', 10);
45:
46: -- get the module id for the spreedsheet input module
47: OPEN csr_module;
40: BEGIN
41: --
42:
43: hr_du_utility.message('ROUT','entry:hr_du_master.create_upload', 5);
44: hr_du_utility.message('PARA','(r_upload_data - record)', 10);
45:
46: -- get the module id for the spreedsheet input module
47: OPEN csr_module;
48: FETCH csr_module INTO l_module_id;
47: OPEN csr_module;
48: FETCH csr_module INTO l_module_id;
49: CLOSE csr_module;
50:
51: hr_du_utility.message('INFO','performing insert', 15);
52:
53: INSERT INTO hr_du_uploads (
54: UPLOAD_ID,
55: MODULE_ID,
91: FETCH csr_upload INTO r_upload_data.upload_id;
92: CLOSE csr_upload;
93:
94:
95: hr_du_utility.message('INFO','created upload', 15);
96: hr_du_utility.message('SUMM','created upload', 20);
97: hr_du_utility.message('ROUT','exit:hr_du_master.create_upload', 25);
98: hr_du_utility.message('PARA','(none)', 30);
99:
92: CLOSE csr_upload;
93:
94:
95: hr_du_utility.message('INFO','created upload', 15);
96: hr_du_utility.message('SUMM','created upload', 20);
97: hr_du_utility.message('ROUT','exit:hr_du_master.create_upload', 25);
98: hr_du_utility.message('PARA','(none)', 30);
99:
100:
93:
94:
95: hr_du_utility.message('INFO','created upload', 15);
96: hr_du_utility.message('SUMM','created upload', 20);
97: hr_du_utility.message('ROUT','exit:hr_du_master.create_upload', 25);
98: hr_du_utility.message('PARA','(none)', 30);
99:
100:
101: -- error handling
94:
95: hr_du_utility.message('INFO','created upload', 15);
96: hr_du_utility.message('SUMM','created upload', 20);
97: hr_du_utility.message('ROUT','exit:hr_du_master.create_upload', 25);
98: hr_du_utility.message('PARA','(none)', 30);
99:
100:
101: -- error handling
102: EXCEPTION
101: -- error handling
102: EXCEPTION
103: WHEN OTHERS THEN
104: -- update status to error
105: hr_du_utility.update_uploads(p_new_status => 'E',
106: p_id => r_upload_data.upload_id);
107: hr_du_utility.error(SQLCODE,'hr_du_master.create_upload','(none)','R');
108: RAISE;
109:
103: WHEN OTHERS THEN
104: -- update status to error
105: hr_du_utility.update_uploads(p_new_status => 'E',
106: p_id => r_upload_data.upload_id);
107: hr_du_utility.error(SQLCODE,'hr_du_master.create_upload','(none)','R');
108: RAISE;
109:
110: --
111: END create_upload;
150: --
151:
152: IF p_login = 'Y' THEN
153: -- initialize messaging
154: hr_du_utility.message_init;
155: END IF;
156:
157: hr_du_utility.message('ROUT','entry:hr_du_master.main', 5);
158: hr_du_utility.message('PARA','(p_filename - ' ||
153: -- initialize messaging
154: hr_du_utility.message_init;
155: END IF;
156:
157: hr_du_utility.message('ROUT','entry:hr_du_master.main', 5);
158: hr_du_utility.message('PARA','(p_filename - ' ||
159: p_filename || ')', 10);
160:
161:
154: hr_du_utility.message_init;
155: END IF;
156:
157: hr_du_utility.message('ROUT','entry:hr_du_master.main', 5);
158: hr_du_utility.message('PARA','(p_filename - ' ||
159: p_filename || ')', 10);
160:
161:
162: -- update record with filename
167:
168:
169: --From the spread sheet to the HR_DU_UPLOAD_LINES
170: l_process := 'spreadsheet input - rollback';
171: hr_du_utility.message('INFO',l_process, 15);
172: hr_du_di_insert.rollback(r_upload_data.upload_id);
173:
174: l_process := 'spreadsheet input - process';
175: hr_du_utility.message('INFO',l_process, 15);
171: hr_du_utility.message('INFO',l_process, 15);
172: hr_du_di_insert.rollback(r_upload_data.upload_id);
173:
174: l_process := 'spreadsheet input - process';
175: hr_du_utility.message('INFO',l_process, 15);
176: hr_du_di_insert.ordered_sequence(r_upload_data.upload_id);
177:
178:
179:
178:
179:
180: -- For the PC to CP conversion
181: l_process := 'PC to CP conversion - rollback';
182: hr_du_utility.message('INFO',l_process, 15);
183: hr_du_dp_pc_conversion.ROLLBACK(r_upload_data.upload_id);
184:
185: l_process := 'PC to CP conversion - validate';
186: hr_du_utility.message('INFO',l_process, 15);
182: hr_du_utility.message('INFO',l_process, 15);
183: hr_du_dp_pc_conversion.ROLLBACK(r_upload_data.upload_id);
184:
185: l_process := 'PC to CP conversion - validate';
186: hr_du_utility.message('INFO',l_process, 15);
187: hr_du_dp_pc_conversion.VALIDATE(r_upload_data.upload_id);
188:
189: l_process := 'PC to CP conversion - process';
190: hr_du_utility.message('INFO',l_process, 15);
186: hr_du_utility.message('INFO',l_process, 15);
187: hr_du_dp_pc_conversion.VALIDATE(r_upload_data.upload_id);
188:
189: l_process := 'PC to CP conversion - process';
190: hr_du_utility.message('INFO',l_process, 15);
191: hr_du_dp_pc_conversion.INSERT_API_MODULE_IDS(r_upload_data.upload_id);
192:
193:
194:
194:
195:
196: -- To Data Pump HR_PUMP_BATCH_LINES
197: l_process := 'transfer to datapump tables - rollback';
198: hr_du_utility.message('INFO',l_process, 15);
199: hr_du_do_datapump.ROLLBACK(r_upload_data.upload_id);
200:
201: l_process := 'transfer to datapump tables - validate';
202: hr_du_utility.message('INFO',l_process, 15);
198: hr_du_utility.message('INFO',l_process, 15);
199: hr_du_do_datapump.ROLLBACK(r_upload_data.upload_id);
200:
201: l_process := 'transfer to datapump tables - validate';
202: hr_du_utility.message('INFO',l_process, 15);
203: hr_du_do_datapump.VALIDATE(r_upload_data.upload_id);
204:
205: l_process := 'transfer to datapump tables - process';
206: hr_du_utility.message('INFO',l_process, 15);
202: hr_du_utility.message('INFO',l_process, 15);
203: hr_du_do_datapump.VALIDATE(r_upload_data.upload_id);
204:
205: l_process := 'transfer to datapump tables - process';
206: hr_du_utility.message('INFO',l_process, 15);
207: hr_du_do_datapump.MAIN(r_upload_data.upload_id);
208:
209:
210:
212: retcode := 0;
213: errbuf := 'No errors - examine logfiles for detailed reports.';
214:
215:
216: hr_du_utility.message('INFO','Main controller', 15);
217: hr_du_utility.message('SUMM','Main controller', 20);
218: hr_du_utility.message('ROUT','exit:hr_du_master.main', 25);
219: hr_du_utility.message('PARA','(retcode - ' || retcode ||
220: ')(errbuf - ' || errbuf || ')', 30);
213: errbuf := 'No errors - examine logfiles for detailed reports.';
214:
215:
216: hr_du_utility.message('INFO','Main controller', 15);
217: hr_du_utility.message('SUMM','Main controller', 20);
218: hr_du_utility.message('ROUT','exit:hr_du_master.main', 25);
219: hr_du_utility.message('PARA','(retcode - ' || retcode ||
220: ')(errbuf - ' || errbuf || ')', 30);
221:
214:
215:
216: hr_du_utility.message('INFO','Main controller', 15);
217: hr_du_utility.message('SUMM','Main controller', 20);
218: hr_du_utility.message('ROUT','exit:hr_du_master.main', 25);
219: hr_du_utility.message('PARA','(retcode - ' || retcode ||
220: ')(errbuf - ' || errbuf || ')', 30);
221:
222:
215:
216: hr_du_utility.message('INFO','Main controller', 15);
217: hr_du_utility.message('SUMM','Main controller', 20);
218: hr_du_utility.message('ROUT','exit:hr_du_master.main', 25);
219: hr_du_utility.message('PARA','(retcode - ' || retcode ||
220: ')(errbuf - ' || errbuf || ')', 30);
221:
222:
223: -- error handling
226: retcode := 2;
227: errbuf := 'An error occurred during the upload - examine logfiles' ||
228: ' for detailed reports. Current process is ' ||
229: l_process || '.';
230: hr_du_utility.error(SQLCODE,'hr_du_master.main',
231: l_process,'R');
232: hr_du_utility.update_uploads(p_new_status => 'E',p_id => r_upload_data.upload_id);
233: WHEN OTHERS THEN
234: retcode := 2;
228: ' for detailed reports. Current process is ' ||
229: l_process || '.';
230: hr_du_utility.error(SQLCODE,'hr_du_master.main',
231: l_process,'R');
232: hr_du_utility.update_uploads(p_new_status => 'E',p_id => r_upload_data.upload_id);
233: WHEN OTHERS THEN
234: retcode := 2;
235: errbuf := 'An error occurred during the upload - examine logfiles' ||
236: ' for detailed reports. Current process is ' ||
234: retcode := 2;
235: errbuf := 'An error occurred during the upload - examine logfiles' ||
236: ' for detailed reports. Current process is ' ||
237: l_process || '.';
238: hr_du_utility.error(SQLCODE,'hr_du_master.main','(none)','R');
239: hr_du_utility.update_uploads(p_new_status => 'E',p_id => r_upload_data.upload_id);
240:
241: --
242: END main;
235: errbuf := 'An error occurred during the upload - examine logfiles' ||
236: ' for detailed reports. Current process is ' ||
237: l_process || '.';
238: hr_du_utility.error(SQLCODE,'hr_du_master.main','(none)','R');
239: hr_du_utility.update_uploads(p_new_status => 'E',p_id => r_upload_data.upload_id);
240:
241: --
242: END main;
243: --