DBA Data[Home] [Help]

APPS.PO_CHORD_WF4 SQL Statements

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

Line: 18

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In Procedure: chord_dist ***' );
Line: 34

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** Finish: chord_dist ***' );
Line: 63

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In procedure: check_dist_change ***' );
Line: 99

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.distribution_num
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.distribution_num <> PODA.distribution_num)
                OR (POD.distribution_num IS NULL
                        AND PODA.distribution_num IS NOT NULL)
                OR (POD.distribution_num IS NOT NULL
                        AND PODA.distribution_num IS NULL)
	       			)
		-- 
		AND POD.distribution_type <> 'AGREEMENT';
Line: 122

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.distribution_num
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.distribution_num <> PODA.distribution_num)
                OR (POD.distribution_num IS NULL
                        AND PODA.distribution_num IS NOT NULL)
                OR (POD.distribution_num IS NOT NULL
                        AND PODA.distribution_num IS NULL)
	       );
Line: 149

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.deliver_to_person_id
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.deliver_to_person_id <> PODA.deliver_to_person_id)
                OR (POD.deliver_to_person_id IS NULL
                        AND PODA.deliver_to_person_id IS NOT NULL)
                OR (POD.deliver_to_person_id IS NOT NULL
                        AND PODA.deliver_to_person_id IS NULL)
	       )
		-- 
	       AND POD.distribution_type <> 'AGREEMENT';
Line: 173

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.deliver_to_person_id
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.deliver_to_person_id <> PODA.deliver_to_person_id)
                OR (POD.deliver_to_person_id IS NULL
                        AND PODA.deliver_to_person_id IS NOT NULL)
                OR (POD.deliver_to_person_id IS NOT NULL
                        AND PODA.deliver_to_person_id IS NULL)
	       );
Line: 201

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.rate_date
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.rate_date <> PODA.rate_date)
                OR (POD.rate_date IS NULL
                        AND PODA.rate_date IS NOT NULL)
                OR (POD.rate_date IS NOT NULL
                        AND PODA.rate_date IS NULL)
	       )
		-- 
	       AND POD.distribution_type <> 'AGREEMENT';
Line: 225

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.rate_date
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.rate_date <> PODA.rate_date)
                OR (POD.rate_date IS NULL
                        AND PODA.rate_date IS NOT NULL)
                OR (POD.rate_date IS NOT NULL
                        AND PODA.rate_date IS NULL)
	       );
Line: 253

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.gl_encumbered_date
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.gl_encumbered_date <> PODA.gl_encumbered_date)
                OR (POD.gl_encumbered_date IS NULL
                        AND PODA.gl_encumbered_date IS NOT NULL)
                OR (POD.gl_encumbered_date IS NOT NULL
                        AND PODA.gl_encumbered_date IS NULL)
	       )
		-- 
               AND POD.distribution_type <> 'AGREEMENT';
Line: 277

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.gl_encumbered_date
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.gl_encumbered_date <> PODA.gl_encumbered_date)
                OR (POD.gl_encumbered_date IS NULL
                        AND PODA.gl_encumbered_date IS NOT NULL)
                OR (POD.gl_encumbered_date IS NOT NULL
                        AND PODA.gl_encumbered_date IS NULL)
	       );
Line: 306

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.code_combination_id
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.code_combination_id <> PODA.code_combination_id)
                OR (POD.code_combination_id IS NULL
                        AND PODA.code_combination_id IS NOT NULL)
                OR (POD.code_combination_id IS NOT NULL
                        AND PODA.code_combination_id IS NULL)
	       			)
		-- 
	       	AND POD.distribution_type <> 'AGREEMENT';
Line: 329

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.code_combination_id
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.code_combination_id <> PODA.code_combination_id)
                OR (POD.code_combination_id IS NULL
                        AND PODA.code_combination_id IS NOT NULL)
                OR (POD.code_combination_id IS NOT NULL
                        AND PODA.code_combination_id IS NULL)
	       );
Line: 358

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.destination_subinventory
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.destination_subinventory <> PODA.destination_subinventory)
                OR (POD.destination_subinventory IS NULL
                        AND PODA.destination_subinventory IS NOT NULL)
                OR (POD.destination_subinventory IS NOT NULL
                        AND PODA.destination_subinventory IS NULL)
	       )
		-- 
	       AND POD.distribution_type <> 'AGREEMENT';
Line: 382

               SELECT DISTINCT 'Y'
               INTO  x_dist_control.destination_subinventory
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
               AND (
                   (PODA.po_distribution_id is NULL)
                OR (POD.destination_subinventory <> PODA.destination_subinventory)
                OR (POD.destination_subinventory IS NULL
                        AND PODA.destination_subinventory IS NOT NULL)
                OR (POD.destination_subinventory IS NOT NULL
                        AND PODA.destination_subinventory IS NULL)
	       );
Line: 411

	       SELECT max(po_chord_wf0.percentage_change(
			 PODA.quantity_ordered, POD.quantity_ordered))
               INTO  x_dist_control.quantity_ordered_change
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
		-- 
	       AND   POD.distribution_type <> 'AGREEMENT';
Line: 429

	       SELECT max(po_chord_wf0.percentage_change(
			 PODA.quantity_ordered, POD.quantity_ordered))
               INTO  x_dist_control.quantity_ordered_change
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y';
Line: 450

	       SELECT max(po_chord_wf0.percentage_change(
			 PODA.rate, POD.rate))
               INTO  x_dist_control.rate_change
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_header_id = x_po_header_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y'
		-- 
	       AND   POD.distribution_type <> 'AGREEMENT';
Line: 468

	       SELECT max(po_chord_wf0.percentage_change(
			 PODA.rate, POD.rate))
               INTO  x_dist_control.rate_change
               FROM  PO_DISTRIBUTIONS_ALL POD,
                     PO_DISTRIBUTIONS_ARCHIVE_ALL PODA
               WHERE
		     POD.po_release_id = x_po_release_id
               AND   POD.po_distribution_id = PODA.po_distribution_id (+)
               AND   PODA.latest_external_flag (+) = 'Y';
Line: 495

          SELECT poh.currency_code
          INTO   l_currency_code
          FROM   po_headers_all poh
          WHERE  poh.po_header_id = x_po_header_id;
Line: 510

	   SELECT max(po_chord_wf0.percentage_change(
                round (
		 decode(POLLA.value_basis, 'RATE',PODA.amount_ordered,'FIXED PRICE', PODA.amount_ordered,
                       (PODA.quantity_ordered*POLLA.price_override))/ l_min_acct_unit )* l_min_acct_unit ,
                round (
                 decode(POLL.value_basis, 'RATE',POD.amount_ordered,'FIXED PRICE', POD.amount_ordered,
                       (POD.quantity_ordered*POLL.price_override)) / l_min_acct_unit )* l_min_acct_unit
              ))
           INTO  x_dist_control.amount_ordered_change
           FROM  PO_DISTRIBUTIONS_ALL POD,
                 PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
                 PO_LINE_LOCATIONS_ALL POLL,
                 PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
           WHERE POD.po_header_id = x_po_header_id
             AND POD.po_distribution_id = PODA.po_distribution_id (+)
             AND PODA.latest_external_flag (+) = 'Y'
             AND POD.distribution_type <> 'AGREEMENT'
             AND POD.line_location_id = POLL.line_location_id       -- Bug 5071741
             AND PODA.line_location_id = POLLA.line_location_id     -- Bug 5071741
             AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
             AND POLLA.latest_external_flag (+) = 'Y'               -- Bug 5071741
             AND POLL.po_release_id is NULL;                        -- Bug 5071741
Line: 534

             SELECT max(po_chord_wf0.percentage_change(
                round (
		 decode(POLLA.value_basis, 'RATE',PODA.amount_ordered,'FIXED PRICE', PODA.amount_ordered,
                       (PODA.quantity_ordered*POLLA.price_override)), l_precision ) ,
                round (
                 decode(POLL.value_basis, 'RATE',POD.amount_ordered,'FIXED PRICE', POD.amount_ordered,
                       (POD.quantity_ordered*POLL.price_override)) , l_precision )
              ))
           INTO  x_dist_control.amount_ordered_change
           FROM  PO_DISTRIBUTIONS_ALL POD,
                 PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
                 PO_LINE_LOCATIONS_ALL POLL,
                 PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
           WHERE POD.po_header_id = x_po_header_id
             AND POD.po_distribution_id = PODA.po_distribution_id (+)
             AND PODA.latest_external_flag (+) = 'Y'
             AND POD.distribution_type <> 'AGREEMENT'
             AND POD.line_location_id = POLL.line_location_id       -- Bug 5071741
             AND PODA.line_location_id = POLLA.line_location_id     -- Bug 5071741
             AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
             AND POLLA.latest_external_flag (+) = 'Y'               -- Bug 5071741
             AND POLL.po_release_id is NULL;                        -- Bug 5071741
Line: 566

          SELECT poh.currency_code
          INTO   l_currency_code
          FROM   po_releases_all por,
                 po_headers_all poh
          WHERE  por.po_release_id = x_po_release_id
          AND    poh.po_header_id = por.po_header_id;
Line: 583

           SELECT max(po_chord_wf0.percentage_change(
                round (
		 decode(POLLA.value_basis,'FIXED PRICE', PODA.amount_ordered,
                       (PODA.quantity_ordered*POLLA.price_override))/ l_min_acct_unit )* l_min_acct_unit ,
                round (
                 decode(POLL.value_basis, 'FIXED PRICE', POD.amount_ordered,
                       (POD.quantity_ordered*POLL.price_override)) / l_min_acct_unit )* l_min_acct_unit
              ))
           INTO  x_dist_control.amount_ordered_change
           FROM  PO_DISTRIBUTIONS_ALL POD,
                 PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
                 PO_LINE_LOCATIONS_ALL POLL,
                 PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
           WHERE POD.po_release_id = x_po_release_id
             AND POD.po_distribution_id = PODA.po_distribution_id (+)
             AND PODA.latest_external_flag (+) = 'Y'
             AND POD.line_location_id = POLL.line_location_id       -- Bug 5071741
             AND PODA.line_location_id = POLLA.line_location_id     -- Bug 5071741
             AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
             AND POLLA.latest_external_flag (+) = 'Y';              -- Bug 5071741
Line: 606

          SELECT max(po_chord_wf0.percentage_change(
                round (
		 decode(POLLA.value_basis,'FIXED PRICE', PODA.amount_ordered,
                       (PODA.quantity_ordered*POLLA.price_override)) , l_precision ) ,
                round (
                 decode(POLL.value_basis, 'FIXED PRICE', POD.amount_ordered,
                       (POD.quantity_ordered*POLL.price_override)) , l_precision )
              ))
           INTO  x_dist_control.amount_ordered_change
           FROM  PO_DISTRIBUTIONS_ALL POD,
                 PO_DISTRIBUTIONS_ARCHIVE_ALL PODA,
                 PO_LINE_LOCATIONS_ALL POLL,
                 PO_LINE_LOCATIONS_ARCHIVE_ALL POLLA
           WHERE POD.po_release_id = x_po_release_id
             AND POD.po_distribution_id = PODA.po_distribution_id (+)
             AND PODA.latest_external_flag (+) = 'Y'
             AND POD.line_location_id = POLL.line_location_id       -- Bug 5071741
             AND PODA.line_location_id = POLLA.line_location_id     -- Bug 5071741
             AND POLL.line_location_id = POLLA.line_location_id (+) -- Bug 5071741
             AND POLLA.latest_external_flag (+) = 'Y';              -- Bug 5071741
Line: 640

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** Finish: check_dist_change ***' );
Line: 647

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** exception check_dist_change ***');
Line: 655

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** exeption: check_dist_change ***');
Line: 669

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In Procedure:set_wf_dist_control  ***' );
Line: 726

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** Finish:set_wf_dist_control  ***' );
Line: 732

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** exeption: set_wf_dist_control ***');
Line: 747

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In Procedure :get_wf_dist_control  ***' );
Line: 799

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** Finished: get_wf_dist_control  ***' );
Line: 813

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In procedure get_wf_dist_parameters ***');
Line: 845

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'po_header_id =  ' || to_char(x_dist_parameters.po_header_id));
Line: 847

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'po_release_id =  '|| to_char(x_dist_parameters.po_release_id));
Line: 852

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** FINISH: get_wf_dist_parameters ***');
Line: 859

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'***set_wf_dist_parameters exception e_invalid_setup *** ');
Line: 867

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'***set_wf_dist_parameters exception  *** ');
Line: 885

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** In Procedure: debug_dist_control ***' );
Line: 890

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'distribution_num         : '|| x_dist_control.distribution_num);
Line: 892

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'deliver_to_person_id     : '|| x_dist_control.deliver_to_person_id);
Line: 894

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'rate_date                : '|| x_dist_control.rate_date);
Line: 896

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'gl_encumbered_date       : '|| x_dist_control.gl_encumbered_date);
Line: 898

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'code_combination_id      : '|| x_dist_control.code_combination_id);
Line: 900

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'destination_subinventory : '|| x_dist_control.destination_subinventory);
Line: 902

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'quantity_ordered_change  : '|| to_char(x_dist_control.quantity_ordered_change));
Line: 904

   	PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,
   		'amount_ordered_change  : '|| to_char(x_dist_control.amount_ordered_change)); --
Line: 909

   	PO_WF_DEBUG_PKG.INSERT_DEBUG(ITEMTYPE, ITEMKEY,
   		'*** Finished:  debug_dist_control **' );