Search Results check_po_dist_exists
Overview
PA_PROJ_TSK_UTILS is a utility package in the Oracle EBS Projects (PA) application, owned by the APPS schema. It provides a set of reusable PL/SQL functions that answer existence and derivation questions about projects, tasks, and the transactional data attached to them. Rather than enforcing business rules or performing transactional writes, the package functions primarily return boolean-style numeric indicators (1 for existence found, 0 for no record found) or an Oracle error code if a query fails. This design allows calling code throughout Oracle Projects — forms, concurrent programs, and custom extensions — to make lightweight, consistent decisions about whether related data exists before attempting edits, deletions, or transfers.
The package dates to the original Oracle Projects releases (header comments reference 1995) and has evolved to include checks against commitments, billing events, expenditure items, payables, and purchasing distributions. It carries the RESTRICT_REFERENCES pragma on its functions, marking them as read-only (WNDS, WNPS), which is significant because it allows these functions to be called directly from SQL statements and from within PL/SQL contexts that require purity guarantees.
Key Procedures and Functions
- GET_TASK_PROJECT_ID — Returns the project ID that owns a given task. If no project ID is found, it returns null; on an Oracle error it returns the error number.
- CHECK_EVENT_EXISTS — Returns 1 if a billing event exists for a project or task, 0 otherwise. If both a project ID and task ID are supplied, the task is the effective subject; events reside at the project and top-task levels.
- CHECK_EXP_ITEM_EXISTS — Returns 1 if an expenditure item exists for a project or task, 0 otherwise. A check_subtasks flag (default TRUE) controls whether lowest-level task detail is considered. Supply of both IDs causes the task to be treated as the subject.
- CHECK_PO_DIST_EXISTS and CHECK_PO_REQ_DIST_EXISTS — Test for the presence of purchasing distribution and purchase requisition distribution records linked to a project or task.
- CHECK_AP_INVOICE_EXISTS and CHECK_AP_INV_DIST_EXISTS — Test for the presence of supplier invoice headers and invoice distribution lines.
- CHECK_FUNDING_EXISTS — Determines whether funding records exist for the project or task.
- CHECK_CDL_EXISTS, CHECK_RDL_EXISTS, and CHECK_ERDL_EXISTS — Check for cost distribution lines, revenue distribution lines, and expense revenue distribution lines respectively.
- CHECK_DRAFT_INV_ITEM_EXISTS, CHECK_DRAFT_REV_ITEM_EXISTS, and CHECK_DRAFT_INV_DETAILS_EXISTS — Verify the presence of draft invoice items, draft revenue items, and draft invoice detail rows.
- CHECK_PROJECT_CUSTOMER_EXISTS — Tests whether a customer association exists for a project, used to guard customer-related operations such as billing or invoicing setup.
- CHECK_PROJECTS_EXISTS — Confirms whether any project records meet the supplied criteria.
- CHECK_COMMITMENT_TXN_EXISTS — Tests for commitment transaction records for the project or task.
- CHECK_COMP_RULE_SET_EXISTS — Tests for the existence of a compensation rule set.
- CHECK_ASSET_ASSIGNMT_EXISTS — Tests for asset assignment records.
- CHECK_JOB_BILL_RATE_OVERRIDE — Tests whether a job billing rate override has been defined.
These functions collectively form a "liveness" inspection layer, permitting callers to decide whether a project or task element can be safely modified or deleted.
Tables Accessed
The package queries a defined set of APPS synonyms, including AP_EXPENSE_REPORT_HEADERS_ALL and AP_EXPENSE_REPORT_LINES_ALL for expense report activity; AP_INVOICES_ALL and AP_INVOICE_DISTRIBUTIONS_ALL for payables linkage; CSD_REPAIRS, CSF_DEBRIEF_LINES, and CS_ESTIMATE_DETAILS for service and depot repair data; PA_COMMITMENT_TXNS for commitments; PA_COMP_RULE_OT_DEFAULTS_ALL for compensation rule defaults; PA_COST_DISTRIBUTION_LINES_ALL for cost distributions; PA_CUST_EVENT_REV_DIST_LINES and PA_CUST_REV_DIST_LINES for revenue distributions; and PA_DRAFT_INVOICE_DETAILS_ALL, PA_DRAFT_INVOICE_ITEMS, and PA_DRAFT_REVENUE_ITEMS for draft invoice and revenue processing. The functions perform read-only existence lookups against these tables, never modifying them.
Usage Notes
PA_PROJ_TSK_UTILS is typically invoked from Oracle Projects forms and concurrent programs that must validate or gate operations involving projects and tasks. Client extensions and custom concurrent programs reference it because it exposes reliable, reusable existence checks rather than reimplementing query logic. With the RESTRICT_REFERENCES pragma applied to each function, the functions may also be called from SQL statements. The package is referenced by four other packages, indicating its role as a shared dependency in the Oracle Projects module. Developers should treat return value 1 as "exists," 0 as "does not exist," and any other number as an Oracle error code from the underlying query.