0% found this document useful (0 votes)
91 views2 pages

Funds - Available Query For Po

The document describes changes made to a SQL query. Specifically, it: 1) Previously had 3 subqueries to retrieve budget, encumbrance, and actual values, but now uses 3 functions passed period/ID parameters to retrieve these values. 2) Removed the gl_balance table from the new query. 3) The rest of the query remains the same with some formatting changes for readability.

Uploaded by

venkat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views2 pages

Funds - Available Query For Po

The document describes changes made to a SQL query. Specifically, it: 1) Previously had 3 subqueries to retrieve budget, encumbrance, and actual values, but now uses 3 functions passed period/ID parameters to retrieve these values. 2) Removed the gl_balance table from the new query. 3) The rest of the query remains the same with some formatting changes for readability.

Uploaded by

venkat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Note:

The difference is, in the earlier query I have written 3 sub queries for budget, encumbrance, actual.

Now I created 3 functions like budget, encumbrance, actual and called in this query by passing the
period year and code combination id’s as parameters to this query, And also removed the gl balance
table in the new query, Rest everything is same.

Query

SELECT distinct

concatenated_segments,

project,

project_desc,

account,

account_desc,

nvl(budget, 0) budget,

nvl(encumbrance, 0) encumbrance,

nvl(actual, 0) actual,

nvl(budget, 0) - nvl(encumbrance, 0) - nvl(actual, 0) funds_available

FROM

SELECT distinct

code_combination_id,

concatenated_segments,

segment11 project,

gl_flexfields_pkg.get_description_sql(chart_of_accounts_id, 11, segment11) project_desc,

segment4 account,

gl_flexfields_pkg.get_description_sql(chart_of_accounts_id, 4, segment4) account_desc,

xxbd_fund_budget(v.period_year, v.line_code_combination_id) budget,


xxbd_fund_encumbrance(v.period_year, v.line_code_combination_id) encumbrance,

xxbd_fund_actual(v.period_year, v.line_code_combination_id) actual

FROM

gl_code_combinations_kfv cc,

psa_je_bcp_lines_v v

WHERE

v.line_code_combination_id = cc.code_combination_id

AND set_of_books_id = 2021

AND cc.code_combination_id IN (

SELECT DISTINCT

gcc.code_combination_id

FROM

po_headers_all

pha, po_lines_all

pla, po_distributions_all

pda, gl_code_combinations_kfv gcc

WHERE

pha.po_header_id = pla.po_header_id

AND pla.po_line_id = pda.po_line_id

AND gcc.code_combination_id = pda.code_combination_id

AND pha.segment1 = :1--'21211000534'

WHERE

1 = 1;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy