2560: BEGIN
2561: --select the previous document_id if it exists on the price book
2562: SELECT document_id
2563: INTO l_document_id
2564: FROM qp_price_book_headers_all_b
2565: WHERE price_book_header_id = p_price_book_header_id;
2566: EXCEPTION
2567: WHEN OTHERS THEN
2568: l_document_id := null;
2568: l_document_id := null;
2569: END;
2570:
2571: IF l_document_id IS NOT NULL THEN
2572: UPDATE qp_price_book_headers_all_b
2573: SET document_id = null
2574: WHERE price_book_header_id = p_price_book_header_id;
2575:
2576: DELETE FROM qp_documents