[Home] [Help]
346:
347: l_stmt_no := 190;
348:
349:
350: /* Now start inserting rows into CST_DEPARTMENT_OVERHEADS table */
351:
352: /* first check for the run option and error out the rows or delete from the base tables */
353:
354: If i_run_option = 2 then
351:
352: /* first check for the run option and error out the rows or delete from the base tables */
353:
354: If i_run_option = 2 then
355: delete from CST_DEPARTMENT_OVERHEADS cdo
356: where exists (select 1 from CST_DEPT_OVERHEADS_INTERFACE cdoi
357: where cdoi.department_id = cdo.department_id
358: AND cdoi.cost_type_id = cdo.cost_type_id
359: AND cdoi.overhead_id = cdo.overhead_id
368: cdoi.error_code = 'CST_CANT_INSERT',
369: cdoi.error_explanation = substrb(fnd_message.get_string('BOM','CST_CANT_INSERT'),1,240)
370: where cdoi.error_flag is null
371: AND cdoi.group_id = SEQ_NEXTVAL
372: AND EXISTS (select 1 from CST_DEPARTMENT_OVERHEADS cdo
373: where cdoi.organization_id = cdo.organization_id
374: AND cdoi.cost_type_id = cdo.cost_type_id
375: AND cdoi.overhead_id = cdo.overhead_id
376: AND cdoi.department_id = cdo.department_id
382: fnd_file.put_line(fnd_file.log,'done deleting or erroring out rows as per run option');
383:
384: l_stmt_no := 195;
385:
386: INSERT INTO CST_DEPARTMENT_OVERHEADS(Department_id,
387: cost_type_id,
388: overhead_id,
389: last_update_date,
390: last_updated_by,
447: sysdate
448: FROM CST_DEPT_OVERHEADS_INTERFACE cdoi
449: WHERE cdoi.error_flag is null
450: AND cdoi.group_id = SEQ_NEXTVAL;
451: fnd_file.put_line(fnd_file.log,'done inserting ' || to_char(SQL%ROWCOUNT) || ' rows into the base table CST_DEPARTMENT_OVERHEADS');
452:
453: l_stmt_no := 200;
454:
455: Update CST_DEPT_OVERHEADS_INTERFACE set