729: /* ATOPUTIL.info(dupl_total_stmt); */
730:
731:
732: stmt_num := 30;
733: dupl_cursor := dbms_sql.open_cursor;
734:
735: stmt_num := 31;
736: dbms_sql.parse(dupl_cursor,dupl_total_stmt,dbms_sql.v7);
737:
732: stmt_num := 30;
733: dupl_cursor := dbms_sql.open_cursor;
734:
735: stmt_num := 31;
736: dbms_sql.parse(dupl_cursor,dupl_total_stmt,dbms_sql.v7);
737:
738: /*
739: ** Here we are defining the position of the select columns
740: */
739: ** Here we are defining the position of the select columns
740: */
741:
742: stmt_num := 32;
743: dbms_sql.define_column(dupl_cursor,1,inv_id);
744:
745: stmt_num := 33;
746: dbms_sql.define_column(dupl_cursor,2,o_id);
747:
742: stmt_num := 32;
743: dbms_sql.define_column(dupl_cursor,1,inv_id);
744:
745: stmt_num := 33;
746: dbms_sql.define_column(dupl_cursor,2,o_id);
747:
748: stmt_num := 34;
749: dbms_sql.bind_variable(dupl_cursor,'org_buf',org_buf);
750:
745: stmt_num := 33;
746: dbms_sql.define_column(dupl_cursor,2,o_id);
747:
748: stmt_num := 34;
749: dbms_sql.bind_variable(dupl_cursor,'org_buf',org_buf);
750:
751: /*
752: ** Get all the duplicated rows into the tables
753: ** We execute the sql statement
753: ** We execute the sql statement
754: */
755:
756: stmt_num :=35;
757: rows_processed := dbms_sql.execute(dupl_cursor);
758:
759: stmt_num := 36;
760:
761: if dbms_sql.fetch_rows(dupl_cursor) = 0 then
757: rows_processed := dbms_sql.execute(dupl_cursor);
758:
759: stmt_num := 36;
760:
761: if dbms_sql.fetch_rows(dupl_cursor) = 0 then
762: /* ATOPUTIL.info('Quitting fetch_rows loop'); */
763: EXIT dupl_per_org_loop;
764: else
765: stmt_num := 101;
762: /* ATOPUTIL.info('Quitting fetch_rows loop'); */
763: EXIT dupl_per_org_loop;
764: else
765: stmt_num := 101;
766: dbms_sql.column_value(dupl_cursor,1,inv_id);
767: dbms_sql.column_value(dupl_cursor,2,o_id);
768: /* ATOPUTIL.info('Duplicate Item:' || inv_id ||', Org_id:'|| o_id ); */
769:
770: select config_number_method_type into org_method
763: EXIT dupl_per_org_loop;
764: else
765: stmt_num := 101;
766: dbms_sql.column_value(dupl_cursor,1,inv_id);
767: dbms_sql.column_value(dupl_cursor,2,o_id);
768: /* ATOPUTIL.info('Duplicate Item:' || inv_id ||', Org_id:'|| o_id ); */
769:
770: select config_number_method_type into org_method
771: from bom_parameters
774: stmt_num := 102;
775: if org_method = 4 THEN RAISE dupl_error;
776: end if;
777:
778: if dbms_sql.is_open(dupl_cursor) then
779: dbms_sql.close_cursor(dupl_cursor);
780: end if;
781:
782: stmt_num := 37;
775: if org_method = 4 THEN RAISE dupl_error;
776: end if;
777:
778: if dbms_sql.is_open(dupl_cursor) then
779: dbms_sql.close_cursor(dupl_cursor);
780: end if;
781:
782: stmt_num := 37;
783: select TO_CHAR(MTL_SYSTEM_ITEMS_INTERFACE_S.NEXTVAL)
1030:
1031: END IF;
1032:
1033: stmt_num := 60;
1034: if dbms_sql.is_open(dupl_cursor) then
1035: dbms_sql.close_cursor(dupl_cursor);
1036: end if;
1037:
1038: /*
1031: END IF;
1032:
1033: stmt_num := 60;
1034: if dbms_sql.is_open(dupl_cursor) then
1035: dbms_sql.close_cursor(dupl_cursor);
1036: end if;
1037:
1038: /*
1039: ** Insert cost records for config items