AP_INVOICES_PKG.GET_APPROVAL_STATUS package extremely slow
I am working on a report that requires the package AP_INVOICES_PKG.GET_APPROVAL_STATUS to obtain the approval status but this package is increasing the execution time extremely in a dev pod! So much so that the report is failing even after increasing the execution time to more than 2 hours. Is there a solution to this high execution time? An alternative to the use of this package is also appreciated.
Please refer to the sample code below:
SELECT
AP_INVOICES_PKG.GET_APPROVAL_STATUS(I.INVOICE_ID, I.INVOICE_AMOUNT,I.PAYMENT_STATUS_FLAG,I.INVOICE_TYPE_LOOKUP_CODE) AS INVOICE_STATUS