DBA Data[Home] [Help]

APPS.PO_REQ_DOCUMENT_UPDATE_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 45

    p_update_source       IN VARCHAR2,
    x_return_status       OUT NOCOPY VARCHAR2,
    x_msg_count           OUT NOCOPY NUMBER,
    x_msg_data            OUT NOCOPY VARCHAR2
) IS

l_api_name    CONSTANT VARCHAR(30) := 'DERIVE_DEPENDENT_FIELDS';
Line: 88

select po_session_gt_s.nextval into l_key from dual;
Line: 92

    INSERT
      INTO po_session_gt
      (key,
      num9,    --Req Line Sequence
      num10,   --Req Distribution ID
      num1)    --Req Distribution Quantity
    select
      l_key,
      l_sequence(i),
      rd.distribution_id,
      --ReqDistributionQuantity: prorated from line
      decode(p_lines.quantity(i), null, null,
        rd.req_line_quantity * p_lines.quantity(i) / rl.quantity)
    FROM po_requisition_lines rl, po_req_distributions rd
    where rl.requisition_line_id = p_lines.req_line_id(i)
      and rd.requisition_line_id = rl.requisition_line_id;
Line: 111

select
  sum(num1),
  max(num10)
BULK COLLECT INTO
  l_dist_total_qty,
  l_last_dist_index
from po_session_gt
where key = l_key
group by num9
order by num9; --Group and Order by Req Line Sequence stored in num9
Line: 126

    update po_session_gt
    set num1 = num1 + (p_lines.quantity(i) - l_dist_total_qty(i))
    where key = l_key and num10 = l_last_dist_index(i);
Line: 132

    update po_session_gt
    set
     num2 --Req New Line Total
     = (select
      --New Line Total
      decode(nvl(p_lines.unit_price(i), nvl(p_lines.quantity(i), p_lines.amount(i))),
        null, null,
      decode(plt.matching_basis, 'AMOUNT',
        nvl(p_lines.amount(i), rl.amount),
        nvl(p_lines.unit_price(i), rl.unit_price)
         * nvl(p_lines.quantity(i), rl.quantity)))
     FROM po_requisition_lines rl, po_req_distributions rd, po_line_types plt
     where rl.requisition_line_id = p_lines.req_line_id(i)
      and rd.requisition_line_id = rl.requisition_line_id
      and rl.line_type_id = plt.line_type_id
      and rd.distribution_id = num10)
   WHERE key = l_key                 -- bug3551463
   AND   num9 = l_sequence(i);       -- bug3551463
Line: 152

SELECT
  num10,      -- Req Distribution ID
  num1,       -- Req Distribution Quantity
  num2        -- Req New Distribution Total
BULK COLLECT INTO
  p_distributions.distribution_id,
  p_distributions.quantity,
  p_distributions.total
FROM po_session_gt
where key = l_key;
Line: 163

delete from po_session_gt where key = l_key;
Line: 212

PROCEDURE update_requisition (
    p_api_version         IN NUMBER,
    p_req_changes         IN OUT NOCOPY PO_REQ_CHANGES_REC_TYPE,
    p_update_source       IN VARCHAR2,
    x_return_status       OUT NOCOPY VARCHAR2,
    x_msg_count           OUT NOCOPY NUMBER,
    x_msg_data            OUT NOCOPY VARCHAR2
) IS

l_api_name    CONSTANT VARCHAR(30) := 'UPDATE_REQUISITION';
Line: 259

    p_mode => 'CHECK_UPDATEABLE',
    p_lock_flag => 'Y',
    x_req_status_rec => l_req_status_rec,
    x_return_status  => x_return_status,
    x_msg_count  => x_msg_count,
    x_msg_data  => x_msg_data);
Line: 282

PO_REQ_DOCUMENT_UPDATE_PVT.derive_dependent_fields(
    p_lines => p_req_changes.line_changes,
    p_distributions => p_req_changes.distribution_changes,
    p_update_source => p_update_source,
    x_return_status  => x_return_status,
    x_msg_count  => x_msg_count,
    x_msg_data  => x_msg_data);
Line: 297

  update po_requisition_lines
  set unit_price=
        nvl(p_req_changes.line_changes.unit_price(i), unit_price),
      currency_unit_price=
        nvl(p_req_changes.line_changes.currency_unit_price(i), currency_unit_price),
      quantity
        =nvl(p_req_changes.line_changes.quantity(i), quantity),
      secondary_quantity
        =nvl(p_req_changes.line_changes.secondary_quantity(i), secondary_quantity),
      need_by_date
        =nvl(p_req_changes.line_changes.need_by_date(i), need_by_date),
      deliver_to_location_id =
        nvl(p_req_changes.line_changes.deliver_to_location_id(i), deliver_to_location_id),
      assignment_start_date
        =nvl(p_req_changes.line_changes.assignment_start_date(i), assignment_start_date),
      assignment_end_date
        =nvl(p_req_changes.line_changes.assignment_end_date(i), assignment_end_date),
      amount =
        nvl(p_req_changes.line_changes.amount(i), amount),
      tax_attribute_update_code =
         'UPDATE'
  where requisition_line_id= p_req_changes.line_changes.req_line_id(i);
Line: 323

  update po_req_distributions
  set req_line_quantity
        =nvl(p_req_changes.distribution_changes.quantity(i), req_line_quantity)
  where distribution_id= p_req_changes.distribution_changes.distribution_id(i);
Line: 369

END update_requisition;