841: buff => constraint_stmt);
842: end if;
843: stmt_num := 7;
844: begin
845: cursor_name := dbms_sql.open_cursor;
846: DBMS_SQL.PARSE(cursor_name, constraint_stmt,dbms_sql.native);
847: dbms_sql.define_column(cursor_name, 1, cnt);
848: for i in 1..bind_list.COUNT loop
849:
842: end if;
843: stmt_num := 7;
844: begin
845: cursor_name := dbms_sql.open_cursor;
846: DBMS_SQL.PARSE(cursor_name, constraint_stmt,dbms_sql.native);
847: dbms_sql.define_column(cursor_name, 1, cnt);
848: for i in 1..bind_list.COUNT loop
849:
850: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
843: stmt_num := 7;
844: begin
845: cursor_name := dbms_sql.open_cursor;
846: DBMS_SQL.PARSE(cursor_name, constraint_stmt,dbms_sql.native);
847: dbms_sql.define_column(cursor_name, 1, cnt);
848: for i in 1..bind_list.COUNT loop
849:
850: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
851:
846: DBMS_SQL.PARSE(cursor_name, constraint_stmt,dbms_sql.native);
847: dbms_sql.define_column(cursor_name, 1, cnt);
848: for i in 1..bind_list.COUNT loop
849:
850: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
851:
852: end loop;
853: rows_processed := dbms_sql.execute_and_fetch(cursor_name);
854: dbms_sql.column_value(cursor_name, 1, cnt);
849:
850: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
851:
852: end loop;
853: rows_processed := dbms_sql.execute_and_fetch(cursor_name);
854: dbms_sql.column_value(cursor_name, 1, cnt);
855: dbms_sql.close_cursor(cursor_name);
856: exception
857: when no_data_found then
850: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
851:
852: end loop;
853: rows_processed := dbms_sql.execute_and_fetch(cursor_name);
854: dbms_sql.column_value(cursor_name, 1, cnt);
855: dbms_sql.close_cursor(cursor_name);
856: exception
857: when no_data_found then
858: cnt := 0;
851:
852: end loop;
853: rows_processed := dbms_sql.execute_and_fetch(cursor_name);
854: dbms_sql.column_value(cursor_name, 1, cnt);
855: dbms_sql.close_cursor(cursor_name);
856: exception
857: when no_data_found then
858: cnt := 0;
859: dbms_sql.close_cursor(cursor_name);
855: dbms_sql.close_cursor(cursor_name);
856: exception
857: when no_data_found then
858: cnt := 0;
859: dbms_sql.close_cursor(cursor_name);
860: when others then
861: if(p_debug = 'Y')then
862: fnd_file.put_line ( Which => FND_FILE.LOG,
863: buff => SUBSTRB(SQLERRM,1,500) );
861: if(p_debug = 'Y')then
862: fnd_file.put_line ( Which => FND_FILE.LOG,
863: buff => SUBSTRB(SQLERRM,1,500) );
864: end if;
865: DBMS_SQL.close_cursor(cursor_name);
866: end;
867:
868: if(p_debug = 'Y')then
869: fnd_file.put_line (Which => FND_FILE.LOG,
1247: end if;
1248: end if;
1249:
1250:
1251: cursor_name := dbms_sql.open_cursor;
1252: DBMS_SQL.PARSE(cursor_name, delete_stmt,dbms_sql.native);
1253: for i in 1..bind_list.COUNT loop
1254:
1255:
1248: end if;
1249:
1250:
1251: cursor_name := dbms_sql.open_cursor;
1252: DBMS_SQL.PARSE(cursor_name, delete_stmt,dbms_sql.native);
1253: for i in 1..bind_list.COUNT loop
1254:
1255:
1256: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1252: DBMS_SQL.PARSE(cursor_name, delete_stmt,dbms_sql.native);
1253: for i in 1..bind_list.COUNT loop
1254:
1255:
1256: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1257:
1258: end loop;
1259: rows_processed:= DBMS_SQL.execute(cursor_name);
1260: dbms_sql.close_cursor(cursor_name);
1255:
1256: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1257:
1258: end loop;
1259: rows_processed:= DBMS_SQL.execute(cursor_name);
1260: dbms_sql.close_cursor(cursor_name);
1261: END LOOP;
1262: action_status := 4; -- deleted successfully
1263: return 0;
1256: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1257:
1258: end loop;
1259: rows_processed:= DBMS_SQL.execute(cursor_name);
1260: dbms_sql.close_cursor(cursor_name);
1261: END LOOP;
1262: action_status := 4; -- deleted successfully
1263: return 0;
1264:
1346: buff => delete_stmt );
1347: END IF;
1348: END IF ;
1349:
1350: cursor_name := DBMS_SQL.OPEN_CURSOR;
1351:
1352: DBMS_SQL.PARSE( cursor_name, delete_stmt, DBMS_SQL.NATIVE );
1353:
1354: FOR i IN 1 .. bind_list.COUNT
1348: END IF ;
1349:
1350: cursor_name := DBMS_SQL.OPEN_CURSOR;
1351:
1352: DBMS_SQL.PARSE( cursor_name, delete_stmt, DBMS_SQL.NATIVE );
1353:
1354: FOR i IN 1 .. bind_list.COUNT
1355: LOOP
1356: DBMS_SQL.BIND_VARIABLE( cursor_name, bind_list(i).bind_name, bind_list(i).bind_value );
1352: DBMS_SQL.PARSE( cursor_name, delete_stmt, DBMS_SQL.NATIVE );
1353:
1354: FOR i IN 1 .. bind_list.COUNT
1355: LOOP
1356: DBMS_SQL.BIND_VARIABLE( cursor_name, bind_list(i).bind_name, bind_list(i).bind_value );
1357: END LOOP;
1358:
1359: rows_processed:= DBMS_SQL.EXECUTE(cursor_name);
1360:
1355: LOOP
1356: DBMS_SQL.BIND_VARIABLE( cursor_name, bind_list(i).bind_name, bind_list(i).bind_value );
1357: END LOOP;
1358:
1359: rows_processed:= DBMS_SQL.EXECUTE(cursor_name);
1360:
1361: DBMS_SQL.CLOSE_CURSOR( cursor_name );
1362:
1363: END LOOP; -- end FOR cur_rec IN delete_cursor
1357: END LOOP;
1358:
1359: rows_processed:= DBMS_SQL.EXECUTE(cursor_name);
1360:
1361: DBMS_SQL.CLOSE_CURSOR( cursor_name );
1362:
1363: END LOOP; -- end FOR cur_rec IN delete_cursor
1364:
1365: action_status := 4; -- deleted successfully
1533: buff => update_stmt);
1534: end if;
1535: update_stmt := update_stmt ||' WHERE '||where_clause;
1536: stmt_num := 2;
1537: cursor_name := dbms_sql.open_cursor;
1538: DBMS_SQL.PARSE(cursor_name, update_stmt,dbms_sql.native);
1539: for i in 1..bind_list.COUNT loop
1540: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1541: end loop;
1534: end if;
1535: update_stmt := update_stmt ||' WHERE '||where_clause;
1536: stmt_num := 2;
1537: cursor_name := dbms_sql.open_cursor;
1538: DBMS_SQL.PARSE(cursor_name, update_stmt,dbms_sql.native);
1539: for i in 1..bind_list.COUNT loop
1540: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1541: end loop;
1542: rows_processed:= DBMS_SQL.execute(cursor_name);
1536: stmt_num := 2;
1537: cursor_name := dbms_sql.open_cursor;
1538: DBMS_SQL.PARSE(cursor_name, update_stmt,dbms_sql.native);
1539: for i in 1..bind_list.COUNT loop
1540: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1541: end loop;
1542: rows_processed:= DBMS_SQL.execute(cursor_name);
1543: dbms_sql.close_cursor(cursor_name);
1544: stmt_num := 3;
1538: DBMS_SQL.PARSE(cursor_name, update_stmt,dbms_sql.native);
1539: for i in 1..bind_list.COUNT loop
1540: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1541: end loop;
1542: rows_processed:= DBMS_SQL.execute(cursor_name);
1543: dbms_sql.close_cursor(cursor_name);
1544: stmt_num := 3;
1545: archive_table := insert_table;
1546: prod_table := table_name;
1539: for i in 1..bind_list.COUNT loop
1540: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1541: end loop;
1542: rows_processed:= DBMS_SQL.execute(cursor_name);
1543: dbms_sql.close_cursor(cursor_name);
1544: stmt_num := 3;
1545: archive_table := insert_table;
1546: prod_table := table_name;
1547: /*
1628: if(p_debug = 'Y')then
1629: fnd_file.put_line (Which => FND_FILE.LOG,
1630: buff => insert_stmt);
1631: end if;
1632: cursor_name := dbms_sql.open_cursor;
1633: DBMS_SQL.PARSE(cursor_name, insert_stmt,dbms_sql.native);
1634: for i in 1..bind_list.COUNT loop
1635:
1636: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1629: fnd_file.put_line (Which => FND_FILE.LOG,
1630: buff => insert_stmt);
1631: end if;
1632: cursor_name := dbms_sql.open_cursor;
1633: DBMS_SQL.PARSE(cursor_name, insert_stmt,dbms_sql.native);
1634: for i in 1..bind_list.COUNT loop
1635:
1636: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1637:
1632: cursor_name := dbms_sql.open_cursor;
1633: DBMS_SQL.PARSE(cursor_name, insert_stmt,dbms_sql.native);
1634: for i in 1..bind_list.COUNT loop
1635:
1636: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1637:
1638: end loop;
1639: rows_processed:= DBMS_SQL.execute(cursor_name);
1640: dbms_sql.close_cursor(cursor_name);
1635:
1636: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1637:
1638: end loop;
1639: rows_processed:= DBMS_SQL.execute(cursor_name);
1640: dbms_sql.close_cursor(cursor_name);
1641: return 0;
1642:
1643: EXCEPTION
1636: DBMS_SQL.BIND_VARIABLE(cursor_name, bind_list(i).bind_name, bind_list(i).bind_value);
1637:
1638: end loop;
1639: rows_processed:= DBMS_SQL.execute(cursor_name);
1640: dbms_sql.close_cursor(cursor_name);
1641: return 0;
1642:
1643: EXCEPTION
1644: WHEN others THEN