DBA Data[Home] [Help]

APPS.PO_DISTRIBUTIONS_SV SQL Statements

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

Line: 94

    SELECT 'unique'
    INTO   l_dummy
    FROM   dual
    WHERE  NOT EXISTS
           ( SELECT 1
             FROM   po_distributions
             WHERE  line_location_id = p_line_location_id
             AND    distribution_num = p_distribution_num
             AND   (rowid              <> p_rowid
                    OR p_rowid IS NULL));
Line: 129

select nvl(max(distribution_num),0)
from   po_distributions
where  line_location_id = x_line_location_id;
Line: 150

  PROCEDURE NAME:       select_summary()

===========================================================================*/

PROCEDURE  select_summary(x_line_location_id IN OUT NOCOPY NUMBER,
                         x_total IN OUT NOCOPY NUMBER) IS

x_progress VARCHAR2(3) := NULL;
Line: 163

select nvl(sum(decode(pol.order_type_lookup_code,'RATE',pod.amount_ordered,
                    'FIXED PRICE',pod.amount_ordered,pod.quantity_ordered)),0)
into x_total
from   po_distributions pod,
       po_lines pol
where pod.po_line_id = pol.po_line_id
and   pod.line_location_id = x_line_location_id;
Line: 175

    po_message_s.sql_error('select_summary', x_progress, sqlcode);
Line: 177

END select_summary;
Line: 213

   select location_code from hr_locations
   where nvl(inventory_organization_id,x_ship_to_org_id) = x_ship_to_org_id
   and   location_id = x_deliver_to_location_id
   UNION
   select (substrb(rtrim(address1)||'-'||rtrim(city),1,20)) location_code from hz_locations
   where location_id = x_deliver_to_location_id ;
Line: 236

                                select  segment1
                                from    pa_projects_all
                                where   project_id = x_project_id
                                union
                                select  project_number
                                from    mrp_seiban_numbers
                                where   project_id = x_project_id;
Line: 253

        select  task_number
        from    pa_tasks
        where   task_id = x_task_id;
Line: 258

            select name
            from HR_ORGANIZATION_UNITS --bug 3342946 (used to be pa_organizations_expend_v)
            where organization_id = x_org_id;
Line: 264

	select line_number
	  from okc_k_lines_b
--Bug# 1633032, togeorge 02/21/2001
-- Just line id enough to pick the line num.
--	 where dnz_chr_id =x_oke_contract_header_id
--	   and id = x_oke_contract_line_id;
Line: 273

	select deliverable_num
	  from oke_k_deliverables_b
	 where k_line_id = x_oke_contract_line_id
	   and deliverable_id = x_oke_contract_deliverable_id;
Line: 376

  select displayed_field
  into x_dest_type
  from   po_destination_types_all_v
  where  lookup_code = x_destination_type_code;
Line: 393

  PROCEDURE NAME:       delete_distributions()

===========================================================================*/

PROCEDURE delete_distributions(x_delete_id NUMBER,
			      x_delete_entity VARCHAR2) IS

x_progress VARCHAR2(3) := NULL;
Line: 405

  IF (X_delete_entity = 'RELEASE') THEN

     	   delete po_distributions_all     /*Bug6632095: using base table instead of view */
	   where line_location_id in
              (select line_location_id
                 from po_line_locations_all
                where po_release_id = x_delete_id);
Line: 413

  ELSIF (X_delete_entity = 'SHIPMENT') THEN

	   delete po_distributions
	   where  line_location_id = x_delete_id;
Line: 418

  ELSIF (X_delete_entity = 'LINE') THEN

	   delete po_distributions
	   where line_location_id in
	      (select line_location_id
	       from po_line_locations
	       where po_line_id = x_delete_id
	       and shipment_type in ('STANDARD', 'PLANNED'));
Line: 427

  ELSIF (X_delete_entity = 'HEADER') THEN

           --
           --We can have encumbrance distributions tied to a BPA header.
           --Allow distributions with distribution_type 'AGREEMENT' to be deleted.
           DELETE    PO_DISTRIBUTIONS_ALL        /*Bug6632095: using base table instead of view */
           WHERE     po_header_id = x_delete_id
                     AND distribution_type in ('STANDARD', 'PLANNED', 'AGREEMENT');
Line: 443

    po_message_s.sql_error('delete_distributions', x_progress, sqlcode);
Line: 445

END delete_distributions;
Line: 468

	 SELECT sum(POD.quantity_ordered)
	 FROM   po_distributions POD
	 WHERE  POD.po_distribution_id = X_po_line_location_id;
Line: 508

	 SELECT max(POD.po_distribution_id)
	 INTO   X_max_distribution_id
	 FROM   po_distributions POD
	 WHERE  POD.line_location_id = X_po_line_location_id;
Line: 538

    select 'Y'
    into   l_exists
    from   dual
	 where exists
             (select 'rcv transaction records'
                  from   rcv_transactions
                  where  po_line_location_id = p_line_location_id);
Line: 558

    select 'Y'
    into   l_exists
	from   dual
	where  exists
             (select 'transaction interface records'
                  from   rcv_transactions_interface
                  where  po_line_location_id = p_line_location_id
                  and    transaction_status_code = 'PENDING');
Line: 582

    select 'Y'
    into   l_exists
	from   dual
	where exists
              (select 'Active invoice distributions'
                 from   ap_invoice_distributions
                 where  po_distribution_id = p_distribution_id
                 and    nvl(cancellation_flag,'N') <> 'Y'
                 and    nvl(reversal_flag,'N') <> 'Y');
Line: 646

PROCEDURE validate_delete_distribution(p_po_distribution_id IN NUMBER
                                      ,p_line_loc_id        IN NUMBER
                                      ,p_approved_date      IN VARCHAR2
                                      ,p_style_disp_name    IN VARCHAR2
                                      ,x_message_text      OUT NOCOPY VARCHAR2) IS
  l_creation_date       po_distributions_all.creation_date%TYPE;
Line: 663

  l_api_name CONSTANT        VARCHAR2(30) := 'validate_delete_distribution';
Line: 664

  d_module   CONSTANT        VARCHAR2(70) := 'po.plsql.PO_DISTRIBUTIONS_SV.validate_delete_distribution';
Line: 672

    SELECT creation_date,
           req_distribution_id,
           po_header_id,
           nvl(quantity_delivered, 0),
           nvl(amount_delivered, 0),
           nvl(encumbered_flag, 'N'),
           nvl(quantity_billed, 0),
           nvl(amount_billed, 0)
    INTO   l_creation_date,
           l_req_distribution_id,
           l_po_header_id,
           l_quantity_delivered,
           l_amount_delivered,
           l_encumbered_flag,
           l_quantity_billed,
           l_amount_billed
    FROM   po_distributions_all
    WHERE  po_distribution_id = p_po_distribution_id;
Line: 703

          select po_distribution_id
          into l_dummy
          FROM po_distributions_all pod
          WHERE pod.line_location_id = p_line_loc_id
          AND   pod.req_distribution_id = l_req_distribution_id;
Line: 724

       x_message_text := PO_CORE_S.get_translated_text('PO_PO_DELETE_DEL_DIST_NA');
Line: 733

       x_message_text := PO_CORE_S.get_translated_text('PO_PO_DELETE_DIST_BILLED_NA');
Line: 757

     select po_distribution_id
     into l_dummy
     FROM po_distributions_all pod
     WHERE pod.line_location_id = p_line_loc_id;
Line: 762

     x_message_text := PO_CORE_S.get_translated_text('PO_CANT_DELETE_ONLY_DIST');
Line: 781

END validate_delete_distribution;