DBA Data[Home] [Help]

APPS.AP_MATCH_UTILITIES_PUB SQL Statements

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

Line: 69

      /* Added the Hold Exists for bug#7203269 in the Select Query*/
      l_sql_stmt := 'SELECT  count(*)
	   	      FROM po_headers			ph,
			   po_distributions		pd,
			   po_releases			pr,
			   ap_invoice_distributions	aid,
			   ap_invoices			ai
	   	     WHERE ph.po_header_id        = :b_po_header_id
		       AND ph.po_header_id        = pd.po_header_id
		       AND pd.po_release_id	  = pr.po_release_id(+)
		       AND pd.po_distribution_id  = aid.po_distribution_id
		       AND aid.invoice_id	  = ai.invoice_id
		       AND nvl(aid.reversal_flag,''N'') <> ''Y''
		       AND (   exists (select ''hold''
                                       from ap_holds_all ah
                                       where ai.invoice_id = ah.invoice_id
                                         and ah.release_lookup_code is null)
                            OR  exists (select ''unvalidated dist''
                                        from ap_invoice_distributions_all aid2,
					     financials_system_params_all fsp
                                         where ai.invoice_id = aid2.invoice_id
					   and fsp.org_id = ai.org_id
                                           and fsp.set_of_books_id = ai.set_of_books_id
                                           and (  (nvl(fsp.purch_encumbrance_flag,''N'') = ''Y'' and
					           nvl(aid2.match_status_flag, ''N'') <> ''A'')
						or (nvl(fsp.purch_encumbrance_flag,''N'') = ''N'' and
					            nvl(aid2.match_status_flag, ''N'') not in (''A'',''T''))
						 )
					  ))';