SQL Id | SQL Text |
089wdhg7y2u65 |
SELECT CUSTOMER_TRX_ID COL1, PAYMENT_SCHEDULE_ID COL2, DELINQUENCY_ID COL3, TRX_NUMBER COL4, ACCOUNT_NUMBER COL5, AMOUNT_DUE_ORIGINAL COL6, INVOICE_CURRENCY_CODE COL7, AMOUNT_DUE_REMAINING COL8, INVOICE_CURRENCY_CODE COL9, ACCTD_AMOUNT_DUE_REMAINING COL10, INVOICE_CURRENCY_CODE COL11, INVOICE_CURRENCY_CODE COL12, DAYS_PAST_DUE COL13, CUST_TRX_CLASS_NAME COL14, CUST_TRX_CLASS_CODE COL15, DUE_DATE COL16, TERMS_SEQUENCE_NUMBER COL17, TRX_DATE COL18, TRX_CREATION_DATE COL19, PARTY_SITE_NUMBER COL20, BILL_TO_LOCATION COL21, BILL_TO_ADDRESS COL22, CUST_TRX_TYPE_NAME COL23, CUST_TRX_STATUS_NAME COL24, AMOUNT_IN_DISPUTE COL25, INVOICE_CURRENCY_CODE COL26, DISPUTE_DATE COL27, NULL COL28, NULL COL29, STAGED_DUNNING_LEVEL COL30, DUNNING_LEVEL_OVERRIDE_DATE COL31, PURCHASE_ORDER COL32, NULL COL33, CONS_INV_ID COL34, CONS_BILLING_NUMBER COL35, NULL COL36, NULL COL37, GL_DATE COL38, TERM_NAME COL39, COMMENTS COL40, PRIMARY_SALESREP_NAME COL41, decode(DEFAULT_
PRINTING_OPTION, 'NOT', ARPT_SQL_FUNC_UTIL.get_lookup_meaning('YES/NO', 'Y'), '') COL42, ARPT_SQL_FUNC_UTIL.get_lookup_meaning('YES/NO', PRINTING_PENDING) COL43, DELINQUENCY_STATUS COL44, UWQ_STATUS COL45, OPERATING_UNIT COL46, DEL_STATUS_DSP COL47, UNPAID_REASON_MEANING COL48, RECEIVABLES_COMMENTS COL49, RECEIVABLES_INTERNAL_NOTES COL50, RECEIVABLES_SPL_INSTRUCTIONS COL51, ATTRIBUTE_CATEGORY COL52, ATTRIBUTE1 COL53, ATTRIBUTE2 COL54, ATTRIBUTE3 COL55, ATTRIBUTE4 COL56, ATTRIBUTE5 COL57, ATTRIBUTE6 COL58, ATTRIBUTE7 COL59, ATTRIBUTE8 COL60, ATTRIBUTE9 COL61, ATTRIBUTE10 COL62, ATTRIBUTE11 COL63, ATTRIBUTE12 COL64, ATTRIBUTE13 COL65, ATTRIBUTE14 COL66, ATTRIBUTE15 COL67, INTERFACE_HEADER_CONTEXT COL68, INTERFACE_HEADER_ATTRIBUTE1 COL69, INTERFACE_HEADER_ATTRIBUTE2 COL70, INTERFACE_HEADER_ATTRIBUTE3 COL71, INTERFACE_HEADER_ATTRIBUTE4 COL72, INTERFACE_HEADER_ATTRIBUTE5 COL73, INTERFACE_HEADER_ATTRIBUTE6 COL74, INTERFACE_HEADER_ATTRIBUTE7 COL75, INTE
RFACE_HEADER_ATTRIBUTE8 COL76, INTERFACE_HEADER_ATTRIBUTE9 COL77, INTERFACE_HEADER_ATTRIBUTE10 COL78, INTERFACE_HEADER_ATTRIBUTE11 COL79, INTERFACE_HEADER_ATTRIBUTE12 COL80, INTERFACE_HEADER_ATTRIBUTE13 COL81, INTERFACE_HEADER_ATTRIBUTE14 COL82, INTERFACE_HEADER_ATTRIBUTE15 COL83, GLOBAL_ATTRIBUTE_CATEGORY COL84, GLOBAL_ATTRIBUTE1 COL85, GLOBAL_ATTRIBUTE2 COL86, GLOBAL_ATTRIBUTE3 COL87, GLOBAL_ATTRIBUTE4 COL88, GLOBAL_ATTRIBUTE5 COL89, GLOBAL_ATTRIBUTE6 COL90, GLOBAL_ATTRIBUTE7 COL91, GLOBAL_ATTRIBUTE8 COL92, GLOBAL_ATTRIBUTE9 COL93, GLOBAL_ATTRIBUTE10 COL94, GLOBAL_ATTRIBUTE11 COL95, GLOBAL_ATTRIBUTE12 COL96, GLOBAL_ATTRIBUTE13 COL97, GLOBAL_ATTRIBUTE14 COL98, GLOBAL_ATTRIBUTE15 COL99, ORG_ID COL100, LEGAL_ENTITY_ID COL101, LEGAL_ENTITY_NAME COL102, NULL COL103 FROM IEX_TRANSACTIONS_V WHERE trunc(due_date) >= :B_DUE_DATE_LOW AND trunc(due_date) <= :B_DUE_DATE_HIGH AND customer_id = :B_CUSTOMER_ID AND PARTY_ID = :B_PARTY_ID AND cust_trx_class_code
= :B_TRX_CLASS AND (delinquency_status in ('DELINQUENT', 'PREDELINQUENT') OR (delinquency_status IS NULL AND amount_due_remaining <> 0) OR (delinquency_status = 'CURRENT' AND amount_due_remaining <> 0)) AND (cust_trx_status_code = 'OP') ORDER BY COL16 DESC |
132qdnqs38dx2 |
SELECT DECODE(:B4 , NULL, PS.ACCTD_AMOUNT_DUE_REMAINING, PS.AMOUNT_DUE_REMAINING), DECODE(:B29 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B28 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B27 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B0, DECODE(:B26 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B25 , CEIL(:B8 -PS.DUE_DATE
)), LEAST(:B24 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B1, DECODE(:B23 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B22 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B21 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B2, DECODE(:B20 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_
ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B19 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B18 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B3, DECODE(:B17 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B16 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B15 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING,
0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B4, DECODE(:B14 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B13 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B12 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B5, DECODE(:B11 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B10 , CEIL(:B8 -PS.DUE_DATE)),
LEAST(:B9 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B6 FROM RA_CUST_TRX_TYPES, AR_PAYMENT_SCHEDULES PS WHERE PS.CUST_TRX_TYPE_ID = RA_CUST_TRX_TYPES.CUST_TRX_TYPE_ID AND PS.CUSTOMER_ID = :B6 AND RA_CUST_TRX_TYPES.ORG_ID= PS.ORG_ID AND DECODE(:B5 , NULL, PS.CUSTOMER_SITE_USE_ID, :B5 ) = PS.CUSTOMER_SITE_USE_ID AND DECODE(UPPER(:B4 ), NULL, PS.INVOICE_CURRENCY_CODE, UPPER(:B4 )) = PS.INVOICE_CURRENCY_CODE AND DECODE(UPPER(:B3 ), 'AGE', 'dummy', 'CM') <> PS.CLASS AND DECODE(UPPER(:B3 ), 'AGE', 'dummy', 'PMT') <> PS.CLASS AND DECODE(:B2 , NULL, RA_CUST_TRX_TYPES.NAME, :B2 ) <= RA_CUST_TRX_TYPES.NAME AND DECODE(:B1 , NULL, RA_CUST_TRX_TYPES.NAME, :B1 ) >= RA_CUST_TRX_TYPES.NAME AND PS.STATUS = 'OP' UNION ALL SELECT -SUM(DECODE(:B4 , NU
LL, APP.ACCTD_AMOUNT_APPLIED_FROM, APP.AMOUNT_APPLIED)), DECODE(:B29 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B28 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B27 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B0, DECODE(:B26 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B25 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B24 , CEIL(:B8
-PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)))B1, DECODE(:B23 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B22 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B21 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B2, DECODE(:B20 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0,
1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B19 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B18 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B3, DECODE(:B17 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B16 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B15 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , '
PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B4, DECODE(:B14 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B13 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B12 , CEIL(:B8 -PS.DUE_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B5, DECODE(:B11 , 'DISPUTE_ONLY', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 0, 1), 'PENDADJ_ONLY', DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 'DISPUTE_PENDADJ', DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 0, 1), 1), DECODE( GREATEST(:B10 , CEIL(:B8 -PS.DUE_DATE)), LEAST(:B9 , CEIL(:B8 -PS.DU
E_DATE)), 1, 0) * DECODE(NVL(PS.AMOUNT_IN_DISPUTE, 0), 0, 1, DECODE(:B7 , 'DISPUTE_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1)) * DECODE(NVL(PS.AMOUNT_ADJUSTED_PENDING, 0), 0, 1, DECODE(:B7 , 'PENDADJ_ONLY', 0, 'DISPUTE_PENDADJ', 0, 1))) B6 FROM AR_PAYMENT_SCHEDULES PS, AR_RECEIVABLE_APPLICATIONS APP WHERE PS.CASH_RECEIPT_ID+0 = APP.CASH_RECEIPT_ID AND APP.STATUS IN ( 'ACC', 'UNAPP', 'UNID', 'OTHER ACC') AND NVL(APP.CONFIRMED_FLAG, 'Y') = 'Y' AND (APP.REVERSAL_GL_DATE > :B8 OR APP.REVERSAL_GL_DATE IS NULL ) AND NVL( PS.RECEIPT_CONFIRMED_FLAG, 'Y' ) = 'Y' AND PS.CUSTOMER_ID = :B6 AND PS.ORG_ID=APP.ORG_ID AND DECODE(:B5 , NULL, NVL(PS.CUSTOMER_SITE_USE_ID, -10), :B5 ) = NVL(PS.CUSTOMER_SITE_USE_ID, -10) AND DECODE(UPPER(:B4 ), NULL, PS.INVOICE_CURRENCY_CODE, UPPER(:B4 )) = PS.INVOICE_CURRENCY_CODE AND DECODE(UPPER(:B3 ), 'AGE', 'dummy', 'CM') <> PS.CLASS AND DECODE(UPPER(:B3 ), 'AGE', 'dummy', 'PMT') <> PS.CLASS AND PS.STATUS = 'OP' GROUP BY PS.DUE
_DATE, PS.AMOUNT_DUE_ORIGINAL, PS.AMOUNT_ADJUSTED, PS.AMOUNT_APPLIED, PS.AMOUNT_CREDITED, PS.GL_DATE, PS.AMOUNT_IN_DISPUTE, PS.AMOUNT_ADJUSTED_PENDING, PS.INVOICE_CURRENCY_CODE, PS.EXCHANGE_RATE, PS.CLASS, DECODE( APP.STATUS, 'UNID', 'UNID', 'UNAPP') |
162ttnv4ubqun | begin OE_DS_PVT.Check_PO_Approved( :t_application_id, :t_entity_short_name, :t_validation_entity_short_name, :t_validation_tmplt_short_name, :t_record_set_short_name, :t_scope, :t_result ); end; |
1p5grz1gs7fjq | select obj#, type#, ctime, mtime, stime, status, dataobj#, flags, oid$, spare1, spare2, spare3, signature, spare7, spare8, spare9 from obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null and linkname is null and subname is null |
1t4ykj11rtya1 | begin FND_MESSAGE.RETRIEVE(:result); end; |
279sut03s49jd |
SELECT X.ORGANIZATION_ID ORGANIZATION_ID , X.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , X.REVISION REVISION , NULL LOT_NUMBER , NULL LOT_EXPIRATION_DATE , X.SUBINVENTORY_CODE SUBINVENTORY_CODE , SUB.RESERVABLE_TYPE RESERVABLE_TYPE , X.LOCATOR_ID LOCATOR_ID , SUM(X.PRIMARY_QUANTITY) PRIMARY_QUANTITY , SUM(X.SECONDARY_QUANTITY) SECONDARY_QUANTITY , X.QUANTITY_TYPE QUANTITY_TYPE , X.COST_GROUP_ID COST_GROUP_ID , X.LPN_ID LPN_ID , X.TRANSACTION_ACTION_ID TRANSACTION_ACTION_ID , X.TRANSFER_SUBINVENTORY_CODE TRANSFER_SUBINVENTORY_CODE , X.TRANSFER_LOCATOR_ID TRANSFER_LOCATOR_ID , NULL IS_RESERVABLE_LOT FROM ( SELECT X.ORGANIZATION_ID ORGANIZATION_ID , X.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , DECODE(:B10 , 2, NULL, X.REVISION) REVISION , NULL LOT_NUMBER , X.SUBINVENTORY_CODE SUBINVENTORY_CODE , X.LOCATOR_ID LOCATOR_ID , SUM(X.PRIMARY_QUANTITY) PRIMARY_QUANTITY , SUM(X.SECONDARY_QUANTITY) SECONDARY_QUANTITY , X.QUANTITY_TYPE QUANTITY_TYPE , X.COST_GROUP_ID COST_GROUP_ID ,
X.LPN_ID LPN_ID , X.TRANSACTION_ACTION_ID TRANSACTION_ACTION_ID , X.TRANSFER_SUBINVENTORY_CODE TRANSFER_SUBINVENTORY_CODE , X.TRANSFER_LOCATOR_ID TRANSFER_LOCATOR_ID FROM ( SELECT MR.ORGANIZATION_ID ORGANIZATION_ID , MR.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , MR.REVISION REVISION , MR.LOT_NUMBER LOT_NUMBER , MR.SUBINVENTORY_CODE SUBINVENTORY_CODE , MR.LOCATOR_ID LOCATOR_ID , MR.PRIMARY_RESERVATION_QUANTITY - NVL(MR.DETAILED_QUANTITY, 0) PRIMARY_QUANTITY , MR.SECONDARY_RESERVATION_QUANTITY - NVL(MR.SECONDARY_DETAILED_QUANTITY, 0) SECONDARY_QUANTITY , 3 QUANTITY_TYPE , TO_NUMBER(NULL) COST_GROUP_ID , LPN_ID LPN_ID , TO_NUMBER(NULL) TRANSACTION_ACTION_ID , TO_CHAR(NULL) TRANSFER_SUBINVENTORY_CODE , TO_NUMBER(NULL) TRANSFER_LOCATOR_ID FROM MTL_RESERVATIONS MR WHERE NVL(MR.SUPPLY_SOURCE_TYPE_ID, 13) = 13 AND MR.PRIMARY_RESERVATION_QUANTITY > NVL(MR.DETAILED_QUANTITY, 0) AND ((:B7 <>1) OR (:B7 = 1 AND MR.LPN_ID IS NULL)) AND (:B6 <> 3 OR (:B6 = 3 AND NOT ( :B5
= MR.DEMAND_SOURCE_TYPE_ID AND :B4 = MR.DEMAND_SOURCE_HEADER_ID AND NVL(:B3 , -9999) = NVL(MR.DEMAND_SOURCE_LINE_ID, -9999) AND NVL(:B2 , '@@@###@@#') = NVL(MR.DEMAND_SOURCE_NAME, '@@@###@@#') AND NVL(:B1 , -9999) = NVL(MR.DEMAND_SOURCE_DELIVERY, -9999) ) ) ) UNION ALL SELECT MOQ.ORGANIZATION_ID ORGANIZATION_ID , MOQ.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , MOQ.REVISION REVISION , MOQ.LOT_NUMBER LOT_NUMBER , MOQ.SUBINVENTORY_CODE SUBINVENTORY_CODE , MOQ.LOCATOR_ID LOCATOR_ID , MOQ.PRIMARY_TRANSACTION_QUANTITY , MOQ.SECONDARY_TRANSACTION_QUANTITY , 1 QUANTITY_TYPE , MOQ.COST_GROUP_ID COST_GROUP_ID , MOQ.LPN_ID LPN_ID , TO_NUMBER(NULL) TRANSACTION_ACTION_ID , TO_CHAR(NULL) TRANSFER_SUBINVENTORY_CODE , TO_NUMBER(NULL) TRANSFER_LOCATOR_ID FROM MTL_ONHAND_QUANTITIES_DETAIL MOQ UNION ALL SELECT MMTT.ORGANIZATION_ID ORGANIZATION_ID , MMTT.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , MMTT.REVISION REVISION , NULL LOT_NUMBER , MMTT.SUBINVENTORY_CODE SUBINVENTORY_CODE , MMTT.LOCATOR_I
D LOCATOR_ID , DECODE(DECODE(MMTT.TRANSACTION_STATUS, 2, DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, -1, 2), MMTT.TRANSACTION_STATUS) , 2, 1, DECODE(MMTT.TRANSACTION_ACTION_ID, 1, -1, 2, -1, 28, -1, 3, -1, SIGN(MMTT.PRIMARY_QUANTITY))) * ROUND(ABS(MMTT.PRIMARY_QUANTITY), 5) , DECODE(DECODE(MMTT.TRANSACTION_STATUS, 2, DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, -1, 2), MMTT.TRANSACTION_STATUS) , 2, 1, DECODE(MMTT.TRANSACTION_ACTION_ID, 1, -1, 2, -1, 28, -1, 3, -1, SIGN(MMTT.SECONDARY_TRANSACTION_QUANTITY))) * ROUND(ABS(MMTT.SECONDARY_TRANSACTION_QUANTITY), 5) , DECODE(MMTT.TRANSACTION_STATUS, 2, DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, 1, 5), 1) QUANTITY_TYPE , MMTT.COST_GROUP_ID COST_GROUP_ID , DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, NVL(MMTT.CONTENT_LPN_ID, MMTT.LPN_ID), NVL(MMTT.ALLOCATED_LPN_ID, NVL(MMTT.CONTENT_LPN_ID, MMTT.LPN_ID))) LPN_ID , DECODE(MMTT.TRANSACTION_STATUS, 2 , DECODE (MP.PROCESS_ENABLED_FLAG, 'Y', DECODE ((SELECT MOVE_ORDER_TYPE FROM MTL_
TXN_REQUEST_HEADERS MTRH WHERE HEADER_ID = MMTT.MOVE_ORDER_HEADER_ID AND ROWNUM = 1), 5, 28, MMTT.TRANSACTION_ACTION_ID), MMTT.TRANSACTION_ACTION_ID), TO_NUMBER(NULL)) TRANSACTION_ACTION_ID , DECODE(MMTT.TRANSACTION_STATUS, 2 , MMTT.TRANSFER_SUBINVENTORY, TO_CHAR(NULL)) TRANSFER_SUBINVENTORY_CODE , DECODE(MMTT.TRANSACTION_STATUS, 2 , MMTT.TRANSFER_TO_LOCATION, TO_NUMBER(NULL)) TRANSFER_LOCATOR_ID FROM MTL_MATERIAL_TRANSACTIONS_TEMP MMTT, MTL_PARAMETERS MP WHERE MMTT.POSTING_FLAG = 'Y' AND MMTT.SUBINVENTORY_CODE IS NOT NULL AND (NVL(MMTT.TRANSACTION_STATUS, 0) <> 2 OR NVL(MMTT.TRANSACTION_STATUS, 0) = 2 AND MMTT.TRANSACTION_ACTION_ID IN (1, 2, 28, 3, 21, 29, 32, 34)) AND MMTT.TRANSACTION_ACTION_ID NOT IN (5, 6, 24, 30) AND MMTT.ORGANIZATION_ID = MP.ORGANIZATION_ID UNION ALL SELECT DECODE(MMTT.TRANSACTION_ACTION_ID, 3, MMTT.TRANSFER_ORGANIZATION, MMTT.ORGANIZATION_ID) ORGANIZATION_ID , MMTT.INVENTORY_ITEM_ID INVENTORY_ITEM_ID , MMTT.REVISION REVISION , NULL LOT_NUM
BER , MMTT.TRANSFER_SUBINVENTORY SUBINVENTORY_CODE , MMTT.TRANSFER_TO_LOCATION LOCATOR_ID , ROUND(ABS(MMTT.PRIMARY_QUANTITY), 5) , ROUND(ABS(MMTT.SECONDARY_TRANSACTION_QUANTITY), 5) , DECODE(NVL(MMTT.TRANSACTION_STATUS, 0), 2, DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, 6, 1 ), 1) QUANTITY_TYPE , MMTT.TRANSFER_COST_GROUP_ID COST_GROUP_ID , NVL(MMTT.CONTENT_LPN_ID, MMTT.TRANSFER_LPN_ID) LPN_ID , TO_NUMBER(NULL) TRANSACTION_ACTION_ID , TO_CHAR(NULL) TRANSFER_SUBINVENTORY_CODE , TO_NUMBER(NULL) TRANSFER_LOCATOR_ID FROM MTL_MATERIAL_TRANSACTIONS_TEMP MMTT WHERE MMTT.POSTING_FLAG = 'Y' AND DECODE( NVL(MMTT.TRANSACTION_STATUS, 0), 2, DECODE(NVL(MMTT.WMS_TASK_STATUS, -1), 4, 1, 2), 1 ) <> 2 AND (MMTT.TRANSACTION_ACTION_ID IN (2, 3) OR (MMTT.TRANSACTION_ACTION_ID = 28 AND :B4 = MMTT.TRANSACTION_SOURCE_ID AND NVL(:B3 , -9999) = NVL(MMTT.TRX_SOURCE_LINE_ID, -9999) AND NVL(:B2 , '@@@###@@#') = NVL(MMTT.TRANSACTION_SOURCE_NAME, '@@@###@@#') AND NVL(:B1 , -9999) = NVL(MM
TT.TRX_SOURCE_DELIVERY_ID, -9999) ) ) AND MMTT.WIP_SUPPLY_TYPE IS NULL ) X WHERE X.ORGANIZATION_ID = :B9 AND X.INVENTORY_ITEM_ID = :B8 GROUP BY X.ORGANIZATION_ID, X.INVENTORY_ITEM_ID, X.REVISION , X.LOT_NUMBER, X.SUBINVENTORY_CODE, X.LOCATOR_ID , X.QUANTITY_TYPE, X.COST_GROUP_ID, X.LPN_ID , X.TRANSACTION_ACTION_ID, X.TRANSFER_SUBINVENTORY_CODE , X.TRANSFER_LOCATOR_ID ) X , MTL_SECONDARY_INVENTORIES SUB WHERE X.ORGANIZATION_ID = SUB.ORGANIZATION_ID (+) AND X.SUBINVENTORY_CODE = SUB.SECONDARY_INVENTORY_NAME (+) AND (:B12 = 2 OR NVL(SUB.ASSET_INVENTORY, 1) = 1) AND ( (:B11 = 1 AND NVL(SUB.INVENTORY_ATP_CODE, 1) = 1) OR (:B11 = 2 AND NVL(SUB.AVAILABILITY_TYPE, 1) = 1 ) OR :B11 =3 OR (:B11 = 4 AND (NVL(SUB.INVENTORY_ATP_CODE, 1) = 1 AND NVL(SUB.AVAILABILITY_TYPE, 1)=1)) ) GROUP BY X.ORGANIZATION_ID , X.INVENTORY_ITEM_ID , X.REVISION , NULL , NULL , SUB.RESERVABLE_TYPE , X.SUBINVENTORY_CODE , NULL , X.LOCATOR_ID , X.QUANTITY_TYPE , X.COST_GROUP_ID , X.LPN_ID , X.TRA
NSACTION_ACTION_ID , X.TRANSFER_SUBINVENTORY_CODE , X.TRANSFER_LOCATOR_ID |
2hzcxxcjkvrz9 |
SELECT ROW_ID, SRC_INVOICING_RULE_ID, ARM_PAYMENT_CHANNEL_CODE, APBA_INACTIVE_DATE, DEFAULT_TAX_EXEMPT_FLAG, ORG_ID, LEGAL_ENTITY_ID, BS_BATCH_SOURCE_NAME, TRX_NUMBER, SOA_AGREEMENT_NAME, RAB_BATCH_NAME, RAC_BILL_TO_CUSTOMER_NAME, RAC_BILL_TO_CUSTOMER_NUM, RAA_BILL_TO_CONCAT_ADDRESS, RAA_BILL_TO_ADDRESS1, RAA_BILL_TO_ADDRESS2, RAA_BILL_TO_ADDRESS3, RAA_BILL_TO_ADDRESS3_DB, RAA_BILL_TO_CITY, FT_BILL_TO_COUNTRY, RAA_BILL_TO_COUNTY, RAA_BILL_TO_POSTAL_CODE, RAA_BILL_TO_PROVINCE, RAA_BILL_TO_STATE, RACO_BILL_TO_CONTACT_NAME, BILL_TO_TAXPAYER_ID, SU_BILL_TO_LOCATION, OF_SHIP_VIA_NAME, CTT_CLASS, COMMENTS, END_DATE_COMMITMENT, START_DATE_COMMITMENT, COMPLETE_FLAG, CT_RELATED_TRX_NUMBER, APBA_BANK_ACCOUNT_NAME, APBA_BANK_ACCOUNT_NUM, APB_CUSTOMER_BANK_BRANCH_NAME, APB_CUSTOMER_BANK_NAME, CUSTOMER_REFERENCE, CUSTOMER_REFERENCE_DATE, INVOICE_CURRENCY_CODE, AL_DEFAULT_TAX_EXEMPT_FLAG, ATTRIBUTE_CATEGORY, ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE5, ATTRIBUTE6, ATTRIBUTE7, ATTRIBUT
E8, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11, ATTRIBUTE12, ATTRIBUTE13, ATTRIBUTE14, ATTRIBUTE15, PS_DISPUTE_AMOUNT, PS_DISPUTE_DATE, DOC_SEQUENCE_VALUE, TERM_DUE_DATE, BILLING_DATE, EXCHANGE_DATE, EXCHANGE_RATE, GDCT_USER_EXCHANGE_RATE_TYPE, AL_FOB_MEANING, FINANCE_CHARGES, GD_GL_DATE, INVOICING_RULE_ID, CT_MODEL_TRX_NUMBER, PRINTING_ORIGINAL_DATE, CT_INVOICE_FOR_CB, PURCHASE_ORDER_DATE, PURCHASE_ORDER_REVISION, SU_PAYING_CUSTOMER_LOCATION, RAC_PAYING_CUSTOMER_NAME, RAC_PAYING_CUSTOMER_NUM, ARM_RECEIPT_METHOD_NAME, PRINTING_COUNT, PRINTING_LAST_PRINTED, PRINTING_OPTION, PURCHASE_ORDER, CT_REFERENCE, RAA_CONCAT_REMIT_TO_ADDRESS, RAA_REMIT_TO_ADDRESS1, RAA_REMIT_TO_ADDRESS2, RAA_REMIT_TO_ADDRESS3, RAA_REMIT_TO_ADDRESS3_DB, RAA_REMIT_TO_CITY, RAA_REMIT_TO_COUNTY, RAA_REMIT_TO_STATE, RAA_REMIT_TO_PROVINCE, RAA_REMIT_TO_POSTAL_CODE, FT_REMIT_TO_COUNTRY, CREDIT_METHOD_FOR_RULES, RAS_PRIMARY_SALESREP_NAME, RAS_PRIMARY_SALESREP_NUM, SHIP_DATE_ACTUAL, RAA_SHIP_TO_CONCAT_ADDRESS, RAA_SHIP_TO_ADDRES
S1, RAA_SHIP_TO_ADDRESS2, RAA_SHIP_TO_ADDRESS3, RAA_SHIP_TO_ADDRESS3_DB, RAA_SHIP_TO_CITY, RAA_SHIP_TO_COUNTY, RAA_SHIP_TO_STATE, RAA_SHIP_TO_PROVINCE, RAA_SHIP_TO_POSTAL_CODE, FT_SHIP_TO_COUNTRY, RAC_SHIP_TO_CUSTOMER_NAME, RACO_SHIP_TO_CONTACT_NAME, RAC_SHIP_TO_CUSTOMER_NUM, SU_SHIP_TO_LOCATION, SHIP_TO_TAXPAYER_ID, RAC_SOLD_TO_CUSTOMER_NAME, RAC_SOLD_TO_CUSTOMER_NUM, INTERNAL_NOTES, CREDIT_METHOD_FOR_INSTALLMENTS, STATUS_TRX, RAT_TERM_NAME, DEFAULT_USSGL_TRANSACTION_CODE, TRX_DATE, INTERFACE_HEADER_CONTEXT, INTERFACE_HEADER_ATTRIBUTE1, INTERFACE_HEADER_ATTRIBUTE2, INTERFACE_HEADER_ATTRIBUTE3, INTERFACE_HEADER_ATTRIBUTE4, INTERFACE_HEADER_ATTRIBUTE5, INTERFACE_HEADER_ATTRIBUTE6, INTERFACE_HEADER_ATTRIBUTE7, INTERFACE_HEADER_ATTRIBUTE8, INTERFACE_HEADER_ATTRIBUTE9, INTERFACE_HEADER_ATTRIBUTE10, INTERFACE_HEADER_ATTRIBUTE11, INTERFACE_HEADER_ATTRIBUTE12, INTERFACE_HEADER_ATTRIBUTE13, INTERFACE_HEADER_ATTRIBUTE14, INTERFACE_HEADER_ATTRIBUTE15, CTT_TYPE_NAME, WAYBILL_NUMBER, CUSTOMER_TRX_
ID, PREVIOUS_CUSTOMER_TRX_ID, INITIAL_CUSTOMER_TRX_ID, RELATED_BATCH_SOURCE_ID, RELATED_CUSTOMER_TRX_ID, CUST_TRX_TYPE_ID, BATCH_ID, BATCH_SOURCE_ID, REASON_CODE, TERM_ID, PRIMARY_SALESREP_ID, AGREEMENT_ID, RECEIPT_METHOD_ID, SHIP_VIA, FOB_POINT, CUSTOMER_BANK_ACCOUNT_ID, PAYMENT_TRXN_EXTENSION_ID, RECURRED_FROM_TRX_NUMBER, SOLD_TO_CUSTOMER_ID, SOLD_TO_SITE_USE_ID, SOLD_TO_CONTACT_ID, BILL_TO_CUSTOMER_ID, BILL_TO_SITE_USE_ID, BILL_TO_CONTACT_ID, SHIP_TO_CUSTOMER_ID, SHIP_TO_SITE_USE_ID, SHIP_TO_CONTACT_ID, REMIT_TO_ADDRESS_ID, CREATED_FROM, PRINTING_PENDING, LAST_PRINTED_SEQUENCE_NUM, EXCHANGE_RATE_TYPE, TERRITORY_ID, DOC_SEQUENCE_ID, PAYING_CUSTOMER_ID, PAYING_SITE_USE_ID, DH_MAX_DISPUTE_DATE, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATED_BY, CREATION_DATE, LAST_UPDATE_LOGIN, BS_AUTO_TRX_NUMBERING_FLAG, BS_BATCH_SOURCE_TYPE, REV_RECOG_RUN_FLAG, CTT_OPEN_RECEIVABLES_FLAG, CTT_ALLOW_FREIGHT_FLAG, CTT_POST_TO_GL_FLAG, CTT_CREATION_SIGN, CTT_ALLOW_OVERAPPLICATION_FLAG, CTT_NATURAL_APP_ONLY_F
LAG, CTT_TAX_CALCULATION_FLAG, CTT_DEFAULT_STATUS, CTT_DEFAULT_TERM, CTT_DEFAULT_PRINTING_OPTION, RAA_BILL_TO_ADDRESS_ID, RAA_SHIP_TO_ADDRESS_ID, ARC_CREATION_METHOD_CODE, ARM_PAYMENT_TYPE_CODE, RAT_TERM_IN_USE_FLAG, RULES_FLAG, ACTIVITY_FLAG, PRINTED_FLAG, POSTED_FLAG, CM_AGAINST_TRX_FLAG, SELECTED_FOR_PAYMENT_FLAG, OVERRIDE_TERMS, COMMITMENTS_EXIST_FLAG, AGREEMENTS_EXIST_FLAG, ATCHMT_FLAG, GLOBAL_ATTRIBUTE1, GLOBAL_ATTRIBUTE2, GLOBAL_ATTRIBUTE3, GLOBAL_ATTRIBUTE4, GLOBAL_ATTRIBUTE5, GLOBAL_ATTRIBUTE6, GLOBAL_ATTRIBUTE7, GLOBAL_ATTRIBUTE8, GLOBAL_ATTRIBUTE9, GLOBAL_ATTRIBUTE10, GLOBAL_ATTRIBUTE11, GLOBAL_ATTRIBUTE12, GLOBAL_ATTRIBUTE13, GLOBAL_ATTRIBUTE14, GLOBAL_ATTRIBUTE15, GLOBAL_ATTRIBUTE16, GLOBAL_ATTRIBUTE17, GLOBAL_ATTRIBUTE18, GLOBAL_ATTRIBUTE19, GLOBAL_ATTRIBUTE20, GLOBAL_ATTRIBUTE_CATEGORY, ORIG_SYSTEM_BATCH_NAME, OLD_TRX_NUMBER, BS_COPY_DOC_NUMBER_FLAG, DEFAULT_REFERENCE FROM RA_CUSTOMER_TRX_PARTIAL_V WHERE (CUSTOMER_TRX_ID=:1) order by CUSTOMER_TRX_ID
|
2jj8xvbkyxtw3 |
SELECT /*+ ORDERED USE_NL(QPQ QPLAT_Q QPLAT_PROD QPA QPL QPH) INDEX(QPQ QP_QUALIFIERS_N1) INDEX(QPLAT_Q qp_preq_line_attrs_tmp_N2) l_list_qual_cur */ QPLAT_PROD.LINE_INDEX, QPL.LIST_LINE_ID, QPL.ARITHMETIC_OPERATOR, QPL.OPERAND, QPL.PRICING_GROUP_SEQUENCE, QPL.LIST_LINE_TYPE_CODE, QPL.PRICING_PHASE_ID, QPL.AUTOMATIC_FLAG, QPL.INCOMPATIBILITY_GRP_CODE, QPL.PRICE_BY_FORMULA_ID, QPL.PRODUCT_PRECEDENCE, QPL.PRIMARY_UOM_FLAG, QPL.MODIFIER_LEVEL_CODE, QPL.LIST_LINE_NO, QPA.PRODUCT_UOM_CODE, QPA.EXCLUDER_FLAG, QPH.LIST_TYPE_CODE, QCDT.ROUNDING_FACTOR, QPH.LIST_HEADER_ID LIST_HEADER_ID, QPLAT_PROD.CONTEXT PRODUCT_ATTRIBUTE_CONTEXT, QPLAT_PROD.ATTRIBUTE PRODUCT_ATTRIBUTE, QPLAT_PROD.VALUE_FROM PRODUCT_ATTR_VALUE_FROM, QPLAT_PROD.ATTRIBUTE_LEVEL PRODUCT_ATTRIBUTE_LEVEL, QPLAT_PROD.ATTRIBUTE_TYPE PRODUCT_ATTRIBUTE_TYPE, QPLAT_PROD.APPLIED_FLAG, NULL PRICING_ATTRIBUTE_CONTEXT, NULL PRICING_ATTRIBUTE, NULL PRICING_ATTR_VALUE_FROM, NULL PRICING_SETUP_VALUE_FROM, NULL PRI
CING_SETUP_VALUE_TO, NULL PRICING_ATTRIBUTE_LEVEL, NULL PRICING_ATTRIBUTE_TYPE, NULL PRICING_OPERATOR_TYPE, QPLAT_Q.CONTEXT QUALIFIER_ATTRIBUTE_CONTEXT, QPLAT_Q.ATTRIBUTE QUALIFIER_ATTRIBUTE, QPLAT_Q.VALUE_FROM QUALIFIER_ATTR_VALUE_FROM, QPLAT_Q.PRICING_ATTR_FLAG QUALIFIER_PRICING_ATTR_FLAG, QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO, QPQ.QUALIFIER_PRECEDENCE QUALIFIER_PRECEDENCE, QPQ.QUALIFIER_DATATYPE QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE SETUP_VALUE_FROM, QPQ.QUALIFIER_ATTR_VALUE_TO SETUP_VALUE_TO, QPQ.COMPARISON_OPERATOR_CODE QUALIFIER_OPERATOR_TYPE, NULL PRICING_ATTRIBUTE_DATATYPE, DECODE(QPQ.LIST_LINE_ID, -1, 'HQ', 'LQ') QUALIFIER_TYPE, QCDT.CURRENCY_DETAIL_ID, QCDT.CURRENCY_HEADER_ID, QCDT.SELLING_ROUNDING_FACTOR, QPLINES.CURRENCY_CODE ORDER_CURRENCY, QPLINES.PRICING_EFFECTIVE_DATE, QPH.CURRENCY_CODE BASE_CURRENCY_CODE , QPL.BREAK_UOM_CODE , QPL.BREAK_UOM_CONTEXT , QPL.BREAK_UOM_ATTRIBUTE , QPLAT_Q.DERIVED_QUALIFIER_FLAG , QPL.PRICE_BREAK_TYPE
_CODE FROM QP_NPREQ_LINES_TMP QPLINES, QP_QUALIFIERS QPQ, QP_NPREQ_LINE_ATTRS_TMP QPLAT_Q, QP_NPREQ_LINE_ATTRS_TMP QPLAT_PROD, QP_PRICING_ATTRIBUTES QPA, QP_LIST_LINES QPL, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS, QP_CURRENCY_DETAILS QCDT WHERE QPA.PRICING_PHASE_ID = :B13 AND QPA.QUALIFICATION_IND = :B12 AND QPLAT_PROD.CONTEXT = QPA.PRODUCT_ATTRIBUTE_CONTEXT AND (QPLINES.PRICE_FLAG = :B3 OR (QPLINES.PRICE_FLAG = :B11 AND :B10 = :B3 )) AND QPLINES.LIST_PRICE_OVERRIDE_FLAG IN ('N', 'O') AND QPLINES.LINE_TYPE_CODE <> :B9 AND QPLINES.VALIDATED_FLAG = :B8 AND QPLINES.QUALIFIERS_EXIST_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE = QPA.PRODUCT_ATTRIBUTE AND QPLAT_PROD.VALUE_FROM = QPA.PRODUCT_ATTR_VALUE AND QPA.EXCLUDER_FLAG = :B8 AND QPL.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPA.LIST_LINE_ID = QPL.LIST_LINE_ID AND QPA.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPH.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AN
D NVL(TRUNC(QPH.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPL.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPL.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPH.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND ( (QCDT.CURR_ATTRIBUTE_CONTEXT IS NULL AND NOT EXISTS (SELECT /*+ ORDERED use_nl(qcdt1) index(pa_tmp QP_PREQ_LINE_ATTRS_TMP_N1) */ 'x' FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP, QP_CURRENCY_DETAILS QCDT1 WHERE QCDT1.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT1.CURR_ATTRIBUTE_CONTEXT = PA_TMP.CONTEXT AND QCDT1.CURR_ATTRIBUTE = PA_TMP.ATTRIBUTE AND QCDT1.CURR_ATTRIBUTE_VALUE = PA_TMP.VALUE_FROM AND QCDT1.CURR_ATTRIBUTE_TYPE = PA_TMP.ATTRIBUTE_TYPE AND QCDT1.TO_CURRENCY_CODE
= QCDT.TO_CURRENCY_CODE AND QCDT1.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP.PRICING_STATUS_CODE = :B1 AND PA_TMP.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT1.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT1.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) ) ) OR (QCDT.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT.CURRENCY_DETAIL_ID = (SELECT QCDT3.CURRENCY_DETAIL_ID FROM QP_CURRENCY_DETAILS QCDT3 WHERE QCDT3.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT3.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT3.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT3.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QCDT3.PRECEDENCE = (SELECT /*+ ORDERED use_nl(qcdt2) index(pa_tmp1 QP_PREQ_LINE_ATTRS_TMP_N1) */ MIN(QCDT2.PRECEDENCE) FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP1, QP_CURRENCY_DETAILS QCDT2 WHERE QCDT2.CURR_ATTRIBUTE_CONTEXT IS NO
T NULL AND QCDT2.CURR_ATTRIBUTE_CONTEXT = PA_TMP1.CONTEXT AND QCDT2.CURR_ATTRIBUTE = PA_TMP1.ATTRIBUTE AND QCDT2.CURR_ATTRIBUTE_VALUE = PA_TMP1.VALUE_FROM AND QCDT2.CURR_ATTRIBUTE_TYPE = PA_TMP1.ATTRIBUTE_TYPE AND QCDT2.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT2.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP1.PRICING_STATUS_CODE = :B1 AND PA_TMP1.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT2.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT2.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) )) ) ) AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND QPLINES.REQUEST_TYPE_CODE = QPRS.REQUEST_TYPE_CODE AND QPH.ACTIVE_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE_TYPE = :B7 AND QPLAT_Q.ATTRIBUTE_TYPE = :B6 AND (QPQ.QUALIFIER_CONTEXT <> :B5 OR QPQ.QUALIFIER_ATTRIBUTE <> :B4 ) AND QPLAT_Q.CONTEXT = QPQ.QUALIFIER_CONTEXT AND QPLAT_Q.ATTRIBUTE = QPQ.QUALIFIER_ATTRIBUTE AND QPQ.LIST_HEADER_ID = QPLINES.PRIC
E_LIST_HEADER_ID AND QPQ.ACTIVE_FLAG = :B3 AND ((QPLAT_Q.VALUE_FROM = QPQ.QUALIFIER_ATTR_VALUE AND QPQ.COMPARISON_OPERATOR_CODE = '=') OR (QPLAT_Q.VALUE_FROM <> QPQ.QUALIFIER_ATTR_VALUE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =') OR QPQ.COMPARISON_OPERATOR_CODE = :B2 ) AND QPLAT_Q.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(QPQ.START_DATE_ACTIVE, QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(QPQ.END_DATE_ACTIVE, QPLINES.PRICING_EFFECTIVE_DATE) AND QPLAT_PROD.LINE_INDEX = QPLAT_Q.LINE_INDEX AND QPLAT_PROD.PRICING_STATUS_CODE = :B1 AND QPLAT_Q. PRICING_STATUS_CODE = :B1 AND (INSTR(QPLINES.PROCESS_STATUS, 'FREEGOOD')=0) AND ((NVL(QPLAT_Q.DERIVED_QUALIFIER_FLAG, 'N')='N') OR (QPLAT_Q.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(QPLINES QPQ QPLAT_Q QPLAT_PROD QPA QPLAT_PRIC QPL QPH) INDEX(QPQ QP_QUALIFIERS_N1) INDEX(QPLAT_Q qp_preq_line_attrs_tmp_N2) INDEX(QPA QP_PRICING_ATTRIBUTES_N5) INDE
X(QPLAT_PRIC qp_preq_line_attrs_tmp_N2) l_list_qual_cur */ QPLAT_PROD.LINE_INDEX, QPL.LIST_LINE_ID, QPL.ARITHMETIC_OPERATOR, QPL.OPERAND, QPL.PRICING_GROUP_SEQUENCE, QPL.LIST_LINE_TYPE_CODE, QPL.PRICING_PHASE_ID, QPL.AUTOMATIC_FLAG, QPL.INCOMPATIBILITY_GRP_CODE, QPL.PRICE_BY_FORMULA_ID, QPL.PRODUCT_PRECEDENCE, QPL.PRIMARY_UOM_FLAG, QPL.MODIFIER_LEVEL_CODE, QPL.LIST_LINE_NO, QPA.PRODUCT_UOM_CODE, QPA.EXCLUDER_FLAG, QPH.LIST_TYPE_CODE, QCDT.ROUNDING_FACTOR, QPH.LIST_HEADER_ID LIST_HEADER_ID, QPLAT_PROD.CONTEXT PRODUCT_ATTRIBUTE_CONTEXT, QPLAT_PROD.ATTRIBUTE PRODUCT_ATTRIBUTE, QPLAT_PROD.VALUE_FROM PRODUCT_ATTR_VALUE_FROM, QPLAT_PROD.ATTRIBUTE_LEVEL PRODUCT_ATTRIBUTE_LEVEL, QPLAT_PROD.ATTRIBUTE_TYPE PRODUCT_ATTRIBUTE_TYPE, QPLAT_PROD.APPLIED_FLAG, QPLAT_PRIC.CONTEXT PRICING_ATTRIBUTE_CONTEXT, QPLAT_PRIC.ATTRIBUTE PRICING_ATTRIBUTE, QPLAT_PRIC.VALUE_FROM PRICING_ATTR_VALUE_FROM, QPA.PRICING_ATTR_VALUE_FROM PRICING_SETUP_VALUE_FROM, QPA.PRICING_ATTR_VALUE_TO PRI
CING_SETUP_VALUE_TO, QPLAT_PRIC.ATTRIBUTE_LEVEL PRICING_ATTRIBUTE_LEVEL, QPLAT_PRIC.ATTRIBUTE_TYPE PRICING_ATTRIBUTE_TYPE, QPA.COMPARISON_OPERATOR_CODE PRICING_OPERATOR_TYPE, QPLAT_Q.CONTEXT QUALIFIER_ATTRIBUTE_CONTEXT, QPLAT_Q.ATTRIBUTE QUALIFIER_ATTRIBUTE, QPLAT_Q.VALUE_FROM QUALIFIER_ATTR_VALUE_FROM, QPLAT_Q.PRICING_ATTR_FLAG QUALIFIER_PRICING_ATTR_FLAG, QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO, QPQ.QUALIFIER_PRECEDENCE QUALIFIER_PRECEDENCE, QPQ.QUALIFIER_DATATYPE QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE SETUP_VALUE_FROM, QPQ.QUALIFIER_ATTR_VALUE_TO SETUP_VALUE_TO, QPQ.COMPARISON_OPERATOR_CODE QUALIFIER_OPERATOR_TYPE, QPA.PRICING_ATTRIBUTE_DATATYPE PRICING_ATTRIBUTE_DATATYPE, DECODE(QPQ.LIST_LINE_ID, -1, 'HQ', 'LQ') QUALIFIER_TYPE, QCDT.CURRENCY_DETAIL_ID, QCDT.CURRENCY_HEADER_ID, QCDT.SELLING_ROUNDING_FACTOR, QPLINES.CURRENCY_CODE ORDER_CURRENCY, QPLINES.PRICING_EFFECTIVE_DATE, QPH.CURRENCY_CODE BASE_CURRENCY_CODE , QPL.BREAK_UOM_CODE , QPL.BREAK_
UOM_CONTEXT , QPL.BREAK_UOM_ATTRIBUTE , QPLAT_Q.DERIVED_QUALIFIER_FLAG , QPL.PRICE_BREAK_TYPE_CODE FROM QP_NPREQ_LINES_TMP QPLINES, QP_QUALIFIERS QPQ, QP_NPREQ_LINE_ATTRS_TMP QPLAT_Q, QP_NPREQ_LINE_ATTRS_TMP QPLAT_PROD, QP_PRICING_ATTRIBUTES QPA, QP_NPREQ_LINE_ATTRS_TMP QPLAT_PRIC, QP_LIST_LINES QPL, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS, QP_CURRENCY_DETAILS QCDT WHERE QPA.PRICING_PHASE_ID = :B13 AND QPA.QUALIFICATION_IND = :B15 AND QPLAT_PROD.CONTEXT = QPA.PRODUCT_ATTRIBUTE_CONTEXT AND (QPLINES.PRICE_FLAG = :B3 OR (QPLINES.PRICE_FLAG = :B11 AND :B10 = :B3 )) AND QPLINES.LIST_PRICE_OVERRIDE_FLAG IN ('N', 'O') AND QPLINES.LINE_TYPE_CODE <> :B9 AND QPLINES.VALIDATED_FLAG = :B8 AND QPLINES.QUALIFIERS_EXIST_FLAG = :B3 AND QPLINES.PRICING_ATTRS_EXIST_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE = QPA.PRODUCT_ATTRIBUTE AND QPLAT_PROD.VALUE_FROM = QPA.PRODUCT_ATTR_VALUE AND QPA.EXCLUDER_FLAG = :B8 AND QPLAT_PRIC.CONTEXT = QPA.PRICING_ATTRIBUTE_CONTEXT AND QPLAT_PRIC.ATTRIB
UTE = QPA.PRICING_ATTRIBUTE AND (QPLAT_PRIC.VALUE_FROM = QPA.PRICING_ATTR_VALUE_FROM OR QPA.COMPARISON_OPERATOR_CODE IN ('NOT =', :B2 )) AND QPLAT_PRIC.ATTRIBUTE_TYPE = :B14 AND QPLAT_PRIC. PRICING_STATUS_CODE = :B1 AND QPLAT_PRIC.LINE_INDEX = QPLAT_PROD.LINE_INDEX AND QPH.LIST_HEADER_ID = QPL.LIST_HEADER_ID AND QPA.LIST_LINE_ID = QPL.LIST_LINE_ID AND QPA.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPH.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPH.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPL.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPL.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPH.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT.END_DATE_
ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND ( (QCDT.CURR_ATTRIBUTE_CONTEXT IS NULL AND NOT EXISTS (SELECT /*+ ORDERED use_nl(qcdt1) index(pa_tmp QP_PREQ_LINE_ATTRS_TMP_N1) */ 'x' FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP, QP_CURRENCY_DETAILS QCDT1 WHERE QCDT1.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT1.CURR_ATTRIBUTE_CONTEXT = PA_TMP.CONTEXT AND QCDT1.CURR_ATTRIBUTE = PA_TMP.ATTRIBUTE AND QCDT1.CURR_ATTRIBUTE_VALUE = PA_TMP.VALUE_FROM AND QCDT1.CURR_ATTRIBUTE_TYPE = PA_TMP.ATTRIBUTE_TYPE AND QCDT1.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT1.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP.PRICING_STATUS_CODE = :B1 AND PA_TMP.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT1.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT1.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) ) ) OR (QCDT.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT.CURRENCY_DETAIL_ID = (SELECT QCDT3.CURRENCY_DETAIL_ID FROM QP_CURRENCY_DETAILS QCDT3 W
HERE QCDT3.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT3.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT3.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT3.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QCDT3.PRECEDENCE = (SELECT /*+ ORDERED use_nl(qcdt2) index(pa_tmp1 QP_PREQ_LINE_ATTRS_TMP_N1) */ MIN(QCDT2.PRECEDENCE) FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP1, QP_CURRENCY_DETAILS QCDT2 WHERE QCDT2.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT2.CURR_ATTRIBUTE_CONTEXT = PA_TMP1.CONTEXT AND QCDT2.CURR_ATTRIBUTE = PA_TMP1.ATTRIBUTE AND QCDT2.CURR_ATTRIBUTE_VALUE = PA_TMP1.VALUE_FROM AND QCDT2.CURR_ATTRIBUTE_TYPE = PA_TMP1.ATTRIBUTE_TYPE AND QCDT2.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT2.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP1.PRICING_STATUS_CODE = :B1 AND PA_TMP1.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT2.START_DATE_ACTIVE), QPLINES
.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT2.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) )) ) ) AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND QPLINES.REQUEST_TYPE_CODE = QPRS.REQUEST_TYPE_CODE AND QPH.ACTIVE_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE_TYPE = :B7 AND QPLAT_Q.ATTRIBUTE_TYPE = :B6 AND (QPQ.QUALIFIER_CONTEXT <> :B5 OR QPQ.QUALIFIER_ATTRIBUTE <> :B4 ) AND QPLAT_Q.CONTEXT = QPQ.QUALIFIER_CONTEXT AND QPLAT_Q.ATTRIBUTE = QPQ.QUALIFIER_ATTRIBUTE AND QPQ.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPQ.ACTIVE_FLAG = :B3 AND ((QPLAT_Q.VALUE_FROM = QPQ.QUALIFIER_ATTR_VALUE AND QPQ.COMPARISON_OPERATOR_CODE = '=') OR (QPLAT_Q.VALUE_FROM <> QPQ.QUALIFIER_ATTR_VALUE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =') OR QPQ.COMPARISON_OPERATOR_CODE = :B2 ) AND QPLAT_Q.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(QPQ.START_DATE_ACTIVE, QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(QPQ.END_DATE_ACTIVE, QPLINES.PRICING_EFFECTIVE_DATE)
AND QPLAT_PROD.LINE_INDEX = QPLINES.LINE_INDEX AND QPLAT_PROD.PRICING_STATUS_CODE = :B1 AND QPLAT_Q. PRICING_STATUS_CODE = :B1 AND (INSTR(QPLINES.PROCESS_STATUS, 'FREEGOOD')=0) AND ((NVL(QPLAT_Q.DERIVED_QUALIFIER_FLAG, 'N')='N') OR (QPLAT_Q.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(QPLINES QPLAT_PROD QPA QPL QPH) index(QPA QP_PRICING_ATTRIBUTES_N5) l_list_cur */ QPLAT_PROD.LINE_INDEX, QPL.LIST_LINE_ID, QPL.ARITHMETIC_OPERATOR, QPL.OPERAND, QPL.PRICING_GROUP_SEQUENCE, QPL.LIST_LINE_TYPE_CODE, QPL.PRICING_PHASE_ID, QPL.AUTOMATIC_FLAG, QPL.INCOMPATIBILITY_GRP_CODE, QPL.PRICE_BY_FORMULA_ID, QPL.PRODUCT_PRECEDENCE, QPL.PRIMARY_UOM_FLAG, QPL.MODIFIER_LEVEL_CODE, QPL.LIST_LINE_NO, QPA.PRODUCT_UOM_CODE, QPA.EXCLUDER_FLAG, QPH.LIST_TYPE_CODE, QCDT.ROUNDING_FACTOR, QPH.LIST_HEADER_ID LIST_HEADER_ID, QPLAT_PROD.CONTEXT PRODUCT_ATTRIBUTE_CONTEXT, QPLAT_PROD.ATTRIBUTE PRODUCT_ATTRIBUTE, QPLAT_PROD.VALUE_FROM P
RODUCT_ATTR_VALUE_FROM, QPLAT_PROD.ATTRIBUTE_LEVEL PRODUCT_ATTRIBUTE_LEVEL, QPLAT_PROD.ATTRIBUTE_TYPE PRODUCT_ATTRIBUTE_TYPE, QPLAT_PROD.APPLIED_FLAG, NULL PRICING_ATTRIBUTE_CONTEXT, NULL PRICING_ATTRIBUTE, NULL PRICING_ATTR_VALUE_FROM, NULL PRICING_SETUP_VALUE_FROM, NULL PRICING_SETUP_VALUE_TO, NULL PRICING_ATTRIBUTE_LEVEL, NULL PRICING_ATTRIBUTE_TYPE, NULL PRICING_OPERATOR_TYPE, NULL QUALIFIER_ATTRIBUTE_CONTEXT, NULL QUALIFIER_ATTRIBUTE, NULL QUALIFIER_ATTR_VALUE_FROM, NULL QUALIFIER_PRICING_ATTR_FLAG, -9999 QUALIFIER_GROUPING_NO, 5000 QUALIFIER_PRECEDENCE, NULL QUALIFIER_DATATYPE, NULL SETUP_VALUE_FROM, NULL SETUP_VALUE_TO, NULL QUALIFIER_OPERATOR_TYPE, NULL PRICING_ATTRIBUTE_DATATYPE, NULL QUALIFIER_TYPE, QCDT.CURRENCY_DETAIL_ID, QCDT.CURRENCY_HEADER_ID, QCDT.SELLING_ROUNDING_FACTOR, QPLINES.CURRENCY_CODE ORDER_CURRENCY, QPLINES.PRICING_EFFECTIVE_DATE, QPH.CURRENCY_CODE BASE_CURRENCY_CODE , QPL.BREAK_UOM_CODE , QPL.BREAK_UOM_CONTEXT , QPL.BREAK_UOM_ATTR
IBUTE , QPLAT_PROD.DERIVED_QUALIFIER_FLAG , QPL.PRICE_BREAK_TYPE_CODE FROM QP_NPREQ_LINES_TMP QPLINES, QP_NPREQ_LINE_ATTRS_TMP QPLAT_PROD, QP_PRICING_ATTRIBUTES QPA, QP_LIST_LINES QPL, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS, QP_CURRENCY_DETAILS QCDT WHERE QPA.PRICING_PHASE_ID = :B13 AND QPA.QUALIFICATION_IND = :B16 AND QPLAT_PROD.CONTEXT = QPA.PRODUCT_ATTRIBUTE_CONTEXT AND (QPLINES.PRICE_FLAG = :B3 OR (QPLINES.PRICE_FLAG = :B11 AND :B10 = :B3 )) AND QPLINES.LIST_PRICE_OVERRIDE_FLAG IN ('N', 'O') AND QPLINES.LINE_TYPE_CODE <> :B9 AND QPLINES.VALIDATED_FLAG = :B8 AND QPLINES.QUALIFIERS_EXIST_FLAG = :B8 AND QPLAT_PROD.ATTRIBUTE = QPA.PRODUCT_ATTRIBUTE AND QPLAT_PROD.VALUE_FROM = QPA.PRODUCT_ATTR_VALUE AND QPA.EXCLUDER_FLAG = :B8 AND QPLAT_PROD.PRICING_STATUS_CODE = :B1 AND QPH.LIST_HEADER_ID = QPL.LIST_HEADER_ID AND QPA.LIST_LINE_ID = QPL.LIST_LINE_ID AND QPA.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPH.STA
RT_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPH.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPL.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPL.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPH.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND ( (QCDT.CURR_ATTRIBUTE_CONTEXT IS NULL AND NOT EXISTS (SELECT /*+ ORDERED use_nl(qcdt1) index(pa_tmp QP_PREQ_LINE_ATTRS_TMP_N1) */ 'x' FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP, QP_CURRENCY_DETAILS QCDT1 WHERE QCDT1.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT1.CURR_ATTRIBUTE_CONTEXT = PA_TMP.CONTEXT AND QCDT1.CURR_ATTRIBUTE = PA_TMP.ATTRIBUTE AND QCDT1.CURR_ATTRIBUTE_VALUE = PA_TMP.VALUE_FROM AND QCDT1.CURR_ATTRIBUTE_TYPE
= PA_TMP.ATTRIBUTE_TYPE AND QCDT1.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT1.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP.PRICING_STATUS_CODE = :B1 AND PA_TMP.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT1.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT1.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) ) ) OR (QCDT.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT.CURRENCY_DETAIL_ID = (SELECT QCDT3.CURRENCY_DETAIL_ID FROM QP_CURRENCY_DETAILS QCDT3 WHERE QCDT3.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT3.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT3.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT3.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QCDT3.PRECEDENCE = (SELECT /*+ ORDERED use_nl(qcdt2) index(pa_tmp1 QP_PREQ_LINE_ATTRS_TMP_N1) */ MIN(QCDT2.PRECEDENCE) FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP1, QP_CURRENCY_DET
AILS QCDT2 WHERE QCDT2.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT2.CURR_ATTRIBUTE_CONTEXT = PA_TMP1.CONTEXT AND QCDT2.CURR_ATTRIBUTE = PA_TMP1.ATTRIBUTE AND QCDT2.CURR_ATTRIBUTE_VALUE = PA_TMP1.VALUE_FROM AND QCDT2.CURR_ATTRIBUTE_TYPE = PA_TMP1.ATTRIBUTE_TYPE AND QCDT2.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT2.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP1.PRICING_STATUS_CODE = :B1 AND PA_TMP1.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT2.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT2.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) )) ) ) AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND QPLINES.REQUEST_TYPE_CODE = QPRS.REQUEST_TYPE_CODE AND QPH.ACTIVE_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE_TYPE = :B7 AND QPLAT_PROD.LINE_INDEX = QPLINES.LINE_INDEX AND (INSTR(QPLINES.PROCESS_STATUS, 'FREEGOOD')=0) UNION ALL SELECT /*+ ORDERED USE_NL(QPLINES QPLAT_PROD QPA QPLAT_PRIC QPL QPH) index(QPA QP_PRIC
ING_ATTRIBUTES_N5) INDEX(QPLAT_PRIC qp_preq_line_attrs_tmp_N2) l_list_cur */ QPLAT_PROD.LINE_INDEX, QPL.LIST_LINE_ID, QPL.ARITHMETIC_OPERATOR, QPL.OPERAND, QPL.PRICING_GROUP_SEQUENCE, QPL.LIST_LINE_TYPE_CODE, QPL.PRICING_PHASE_ID, QPL.AUTOMATIC_FLAG, QPL.INCOMPATIBILITY_GRP_CODE, QPL.PRICE_BY_FORMULA_ID, QPL.PRODUCT_PRECEDENCE, QPL.PRIMARY_UOM_FLAG, QPL.MODIFIER_LEVEL_CODE, QPL.LIST_LINE_NO, QPA.PRODUCT_UOM_CODE, QPA.EXCLUDER_FLAG, QPH.LIST_TYPE_CODE, QCDT.ROUNDING_FACTOR, QPH.LIST_HEADER_ID LIST_HEADER_ID, QPLAT_PROD.CONTEXT PRODUCT_ATTRIBUTE_CONTEXT, QPLAT_PROD.ATTRIBUTE PRODUCT_ATTRIBUTE, QPLAT_PROD.VALUE_FROM PRODUCT_ATTR_VALUE_FROM, QPLAT_PROD.ATTRIBUTE_LEVEL PRODUCT_ATTRIBUTE_LEVEL, QPLAT_PROD.ATTRIBUTE_TYPE PRODUCT_ATTRIBUTE_TYPE, QPLAT_PROD.APPLIED_FLAG, QPLAT_PRIC.CONTEXT PRICING_ATTRIBUTE_CONTEXT, QPLAT_PRIC.ATTRIBUTE PRICING_ATTRIBUTE, QPLAT_PRIC.VALUE_FROM PRICING_ATTR_VALUE_FROM, QPA.PRICING_ATTR_VALUE_FROM PRICING_SETUP_VALUE_FROM, QPA.PRICING
_ATTR_VALUE_TO PRICING_SETUP_VALUE_TO, QPLAT_PRIC.ATTRIBUTE_LEVEL PRICING_ATTRIBUTE_LEVEL, QPLAT_PRIC.ATTRIBUTE_TYPE PRICING_ATTRIBUTE_TYPE, QPA.COMPARISON_OPERATOR_CODE PRICING_OPERATOR_TYPE, NULL QUALIFIER_ATTRIBUTE_CONTEXT, NULL QUALIFIER_ATTRIBUTE, NULL QUALIFIER_ATTR_VALUE_FROM, NULL QUALIFIER_PRICING_ATTR_FLAG, -9999 QUALIFIER_GROUPING_NO, 5000 QUALIFIER_PRECEDENCE, NULL QUALIFIER_DATATYPE, NULL SETUP_VALUE_FROM, NULL SETUP_VALUE_TO, NULL QUALIFIER_OPERATOR_TYPE, QPA.PRICING_ATTRIBUTE_DATATYPE PRICING_ATTRIBUTE_DATATYPE, NULL QUALIFIER_TYPE, QCDT.CURRENCY_DETAIL_ID, QCDT.CURRENCY_HEADER_ID, QCDT.SELLING_ROUNDING_FACTOR, QPLINES.CURRENCY_CODE ORDER_CURRENCY, QPLINES.PRICING_EFFECTIVE_DATE, QPH.CURRENCY_CODE BASE_CURRENCY_CODE , QPL.BREAK_UOM_CODE , QPL.BREAK_UOM_CONTEXT , QPL.BREAK_UOM_ATTRIBUTE , QPLAT_PRIC.DERIVED_QUALIFIER_FLAG , QPL.PRICE_BREAK_TYPE_CODE FROM QP_NPREQ_LINES_TMP QPLINES, QP_NPREQ_LINE_ATTRS_TMP QPLAT_PROD, QP_PRICING_ATTRIBUTES QPA, QP_N
PREQ_LINE_ATTRS_TMP QPLAT_PRIC, QP_LIST_LINES QPL, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS, QP_CURRENCY_DETAILS QCDT WHERE QPA.PRICING_PHASE_ID = :B13 AND QPA.QUALIFICATION_IND = :B17 AND QPLAT_PROD.CONTEXT = QPA.PRODUCT_ATTRIBUTE_CONTEXT AND (QPLINES.PRICE_FLAG = :B3 OR (QPLINES.PRICE_FLAG = :B11 AND :B10 = :B3 )) AND QPLINES.LIST_PRICE_OVERRIDE_FLAG IN ('N', 'O') AND QPLINES.LINE_TYPE_CODE <> :B9 AND QPLINES.VALIDATED_FLAG = :B8 AND QPLINES.QUALIFIERS_EXIST_FLAG = :B8 AND QPLINES.PRICING_ATTRS_EXIST_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE = QPA.PRODUCT_ATTRIBUTE AND QPLAT_PROD.VALUE_FROM = QPA.PRODUCT_ATTR_VALUE AND QPA.EXCLUDER_FLAG = :B8 AND QPLAT_PROD.PRICING_STATUS_CODE = :B1 AND QPLAT_PRIC.CONTEXT = QPA.PRICING_ATTRIBUTE_CONTEXT AND QPLAT_PRIC.ATTRIBUTE = QPA.PRICING_ATTRIBUTE AND (QPLAT_PRIC.VALUE_FROM = QPA.PRICING_ATTR_VALUE_FROM OR QPA.COMPARISON_OPERATOR_CODE IN ('NOT =', :B2 )) AND QPLAT_PRIC.ATTRIBUTE_TYPE = :B14 AND QPLAT_PRIC. PRICING_STATUS_CODE = :B
1 AND QPLAT_PRIC.LINE_INDEX = QPLAT_PROD.LINE_INDEX AND QPH.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPA.LIST_LINE_ID = QPL.LIST_LINE_ID AND QPA.LIST_HEADER_ID = QPLINES.PRICE_LIST_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPH.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPH.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QPL.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QPL.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QPH.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND ( (QCDT.CURR_ATTRIBUTE_CONTEXT IS NULL AND NOT EXISTS (SELECT /*+ ORDERED use_nl(qcdt1) index(pa_tmp QP_PREQ_LINE_ATTRS_TMP_N1) */ 'x' FROM QP_NPREQ_LINE_ATTRS_
TMP PA_TMP, QP_CURRENCY_DETAILS QCDT1 WHERE QCDT1.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT1.CURR_ATTRIBUTE_CONTEXT = PA_TMP.CONTEXT AND QCDT1.CURR_ATTRIBUTE = PA_TMP.ATTRIBUTE AND QCDT1.CURR_ATTRIBUTE_VALUE = PA_TMP.VALUE_FROM AND QCDT1.CURR_ATTRIBUTE_TYPE = PA_TMP.ATTRIBUTE_TYPE AND QCDT1.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT1.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP.PRICING_STATUS_CODE = :B1 AND PA_TMP.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT1.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT1.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) ) ) OR (QCDT.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT.CURRENCY_DETAIL_ID = (SELECT QCDT3.CURRENCY_DETAIL_ID FROM QP_CURRENCY_DETAILS QCDT3 WHERE QCDT3.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT3.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT3.START_DATE_ACTIVE), QPLINES.PRICING_EFF
ECTIVE_DATE) AND NVL(TRUNC(QCDT3.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND QCDT3.PRECEDENCE = (SELECT /*+ ORDERED use_nl(qcdt2) index(pa_tmp1 QP_PREQ_LINE_ATTRS_TMP_N1) */ MIN(QCDT2.PRECEDENCE) FROM QP_NPREQ_LINE_ATTRS_TMP PA_TMP1, QP_CURRENCY_DETAILS QCDT2 WHERE QCDT2.CURR_ATTRIBUTE_CONTEXT IS NOT NULL AND QCDT2.CURR_ATTRIBUTE_CONTEXT = PA_TMP1.CONTEXT AND QCDT2.CURR_ATTRIBUTE = PA_TMP1.ATTRIBUTE AND QCDT2.CURR_ATTRIBUTE_VALUE = PA_TMP1.VALUE_FROM AND QCDT2.CURR_ATTRIBUTE_TYPE = PA_TMP1.ATTRIBUTE_TYPE AND QCDT2.TO_CURRENCY_CODE = QCDT.TO_CURRENCY_CODE AND QCDT2.CURRENCY_HEADER_ID = QCDT.CURRENCY_HEADER_ID AND PA_TMP1.PRICING_STATUS_CODE = :B1 AND PA_TMP1.LINE_INDEX = QPLINES.LINE_INDEX AND QPLINES.PRICING_EFFECTIVE_DATE BETWEEN NVL(TRUNC(QCDT2.START_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) AND NVL(TRUNC(QCDT2.END_DATE_ACTIVE), QPLINES.PRICING_EFFECTIVE_DATE) )) ) ) AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND QPLINES.REQUEST_TYPE_CODE = QPRS.REQUEST_TYPE_
CODE AND QPH.ACTIVE_FLAG = :B3 AND QPLAT_PROD.ATTRIBUTE_TYPE = :B7 AND QPLAT_PROD.LINE_INDEX = QPLINES.LINE_INDEX AND (INSTR(QPLINES.PROCESS_STATUS, 'FREEGOOD')=0) ORDER BY 1, 2 |
2qh8v5safwdg0 | begin OE_2PC2_LINE_RETLIN.Is_Valid( :t_application_id, :t_entity_short_name, :t_validation_entity_short_name, :t_validation_tmplt_short_name, :t_record_set_short_name, :t_scope, :t_result ); end; |
357ymr0xrucg6 | begin :con := "MO_GLOBAL"."ORG_SECURITY"(:sn, :on); end; |
39m4sx9k63ba2 | select /*+ index(idl_ub2$ i_idl_ub21) +*/ piece#, length, piece from idl_ub2$ where obj#=:1 and part=:2 and version=:3 order by piece# |
3mbz7cvyf9cz3 | BEGIN WSH_SHIP_CONFIRM_ACTIONS.interface_ALL_wrp(:errbuf, :rc, :A0, :A1, :A2, :A3); END; |
3un99a0zwp4vd | select owner#, name, namespace, remoteowner, linkname, p_timestamp, p_obj#, nvl(property, 0), subname, type#, flags, d_attrs from dependency$ d, obj$ o where d_obj#=:1 and p_obj#=obj#(+) order by order# |
42k5aw3va97fy |
SELECT ACCOUNTING_RULE_ID , ACCOUNTING_RULE_DURATION , AGREEMENT_ID , ATTRIBUTE1 , ATTRIBUTE10 , ATTRIBUTE11 , ATTRIBUTE12 , ATTRIBUTE13 , ATTRIBUTE14 , ATTRIBUTE15 , ATTRIBUTE16 , ATTRIBUTE17 , ATTRIBUTE18 , ATTRIBUTE19 , ATTRIBUTE2 , ATTRIBUTE20 , ATTRIBUTE3 , ATTRIBUTE4 , ATTRIBUTE5 , ATTRIBUTE6 , ATTRIBUTE7 , ATTRIBUTE8 , ATTRIBUTE9 , BLANKET_NUMBER , BOOKED_FLAG , BOOKED_DATE , CANCELLED_FLAG , CONTEXT , CONVERSION_RATE , CONVERSION_RATE_DATE , CONVERSION_TYPE_CODE , CUSTOMER_PREFERENCE_SET_CODE , CREATED_BY , CREATION_DATE , CUST_PO_NUMBER , DELIVER_TO_CONTACT_ID , DELIVER_TO_ORG_ID , DEMAND_CLASS_CODE , FIRST_ACK_CODE , FIRST_ACK_DATE , EXPIRATION_DATE , EARLIEST_SCHEDULE_LIMIT , FOB_POINT_CODE , FREIGHT_CARRIER_CODE , FREIGHT_TERMS_CODE , GLOBAL_ATTRIBUTE1 , GLOBAL_ATTRIBUTE10 , GLOBAL_ATTRIBUTE11 , GLOBAL_ATTRIBUTE12 , GLOBAL_ATTRIBUTE13 , GLOBAL_ATTRIBUTE14 , GLOBAL_ATTRIBUTE15 , GLOBAL_ATTRIBUTE16 , GLOBAL_ATTRIBUTE17 , G
LOBAL_ATTRIBUTE18 , GLOBAL_ATTRIBUTE19 , GLOBAL_ATTRIBUTE2 , GLOBAL_ATTRIBUTE20 , GLOBAL_ATTRIBUTE3 , GLOBAL_ATTRIBUTE4 , GLOBAL_ATTRIBUTE5 , GLOBAL_ATTRIBUTE6 , GLOBAL_ATTRIBUTE7 , GLOBAL_ATTRIBUTE8 , GLOBAL_ATTRIBUTE9 , GLOBAL_ATTRIBUTE_CATEGORY , HEADER_ID , INVOICE_TO_CONTACT_ID , INVOICE_TO_ORG_ID , INVOICING_RULE_ID , LAST_ACK_CODE , LAST_ACK_DATE , LAST_UPDATED_BY , LAST_UPDATE_DATE , LAST_UPDATE_LOGIN , LATEST_SCHEDULE_LIMIT , OPEN_FLAG , ORDERED_DATE , ORDER_DATE_TYPE_CODE , ORDER_NUMBER , ORDER_SOURCE_ID , ORDER_TYPE_ID , ORDER_CATEGORY_CODE , ORG_ID , ORIG_SYS_DOCUMENT_REF , PARTIAL_SHIPMENTS_ALLOWED , PAYMENT_TERM_ID , PRICE_LIST_ID , PRICE_REQUEST_CODE , PRICING_DATE , PROGRAM_APPLICATION_ID , PROGRAM_ID , PROGRAM_UPDATE_DATE , REQUEST_DATE , REQUEST_ID , RETURN_REASON_CODE , SALESREP_ID , SALES_CHANNEL_CODE , SHIPMENT_PRIORITY_CODE , SHIPPING_METHOD_CODE , SHIP_FROM_ORG_ID , SHIP_TOLERANCE_ABOVE , SHIP_TOLERANCE_BELOW , SHI
P_TO_CONTACT_ID , SHIP_TO_ORG_ID , SOLD_FROM_ORG_ID , SOLD_TO_CONTACT_ID , SOLD_TO_ORG_ID , SOLD_TO_PHONE_ID , SOURCE_DOCUMENT_ID , SOURCE_DOCUMENT_TYPE_ID , TAX_EXEMPT_FLAG , TAX_EXEMPT_NUMBER , TAX_EXEMPT_REASON_CODE , TAX_POINT_CODE , TRANSACTIONAL_CURR_CODE , VERSION_NUMBER , PAYMENT_TYPE_CODE , PAYMENT_AMOUNT , CHECK_NUMBER , CREDIT_CARD_CODE , CREDIT_CARD_HOLDER_NAME , CREDIT_CARD_NUMBER , CREDIT_CARD_EXPIRATION_DATE , CREDIT_CARD_APPROVAL_DATE , CREDIT_CARD_APPROVAL_CODE , SHIPPING_INSTRUCTIONS , PACKING_INSTRUCTIONS , FLOW_STATUS_CODE , MARKETING_SOURCE_CODE_ID , DEFAULT_FULFILLMENT_SET , FULFILLMENT_SET_NAME , LINE_SET_NAME , TP_ATTRIBUTE1 , TP_ATTRIBUTE10 , TP_ATTRIBUTE11 , TP_ATTRIBUTE12 , TP_ATTRIBUTE13 , TP_ATTRIBUTE14 , TP_ATTRIBUTE15 , TP_ATTRIBUTE2 , TP_ATTRIBUTE3 , TP_ATTRIBUTE4 , TP_ATTRIBUTE5 , TP_ATTRIBUTE6 , TP_ATTRIBUTE7 , TP_ATTRIBUTE8 , TP_ATTRIBUTE9 , TP_CONTEXT , XML_MESSAGE_ID , UPGRADED_FLAG , LOCK_CONTROL , C
HANGE_SEQUENCE , QUOTE_DATE , QUOTE_NUMBER , SALES_DOCUMENT_NAME , TRANSACTION_PHASE_CODE , USER_STATUS_CODE , DRAFT_SUBMITTED_FLAG , SOURCE_DOCUMENT_VERSION_NUMBER , SOLD_TO_SITE_USE_ID , MINISITE_ID , IB_OWNER , IB_INSTALLED_AT_LOCATION , IB_CURRENT_LOCATION , END_CUSTOMER_ID , END_CUSTOMER_CONTACT_ID , END_CUSTOMER_SITE_USE_ID , SUPPLIER_SIGNATURE , SUPPLIER_SIGNATURE_DATE , CUSTOMER_SIGNATURE , CUSTOMER_SIGNATURE_DATE , ORDER_FIRMED_DATE FROM OE_ORDER_HEADERS_ALL WHERE HEADER_ID = :B1 |
4mcu5twpk5m68 |
SELECT R.Conc_Login_Id, R.Request_Id, R.Phase_Code, R.Status_Code, P.Application_ID, P.Concurrent_Program_ID, P.Concurrent_Program_Name, R.Enable_Trace, R.Restart, DECODE(R.Increment_Dates, 'Y', 'Y', 'N'), R.NLS_Compliant, R.OUTPUT_FILE_TYPE, E.Executable_Name, E.Execution_File_Name, A2.Basepath, DECODE(R.Stale, 'Y', 'C', P.Execution_Method_Code), P.Print_Flag, P.Execution_Options, DECODE(P.Srs_Flag, 'Y', 'Y', 'Q', 'Y', 'N'), P.Argument_Method_Code, R.Print_Style, R.Argument_Input_Method_Code, R.Queue_Method_Code, R.Responsibility_ID, R.Responsibility_Application_ID, R.Requested_By, R.Number_Of_Copies, R.Save_Output_Flag, R.Printer, R.Print_Group, R.Priority, U.User_Name, O.Oracle_Username, O.Encrypted_Oracle_Password, R.Cd_Id, A.Basepath, A.Application_Short_Name, TO_CHAR(R.Requested_Start_Date, 'YYYY/MM/DD HH24:MI:SS'), R.Nls_Language, R.Nls_Territory, R.Nls_Numeric_Characters, DECODE(R.Parent_Request_ID, NULL, 0, R.Parent_Reque
st_ID), R.Priority_Request_ID, R.Single_Thread_Flag, R.Has_Sub_Request, R.Is_Sub_Request, R.Req_Information, R.Description, R.Resubmit_Time, TO_CHAR(R.Resubmit_Interval), R.Resubmit_Interval_Type_Code, R.Resubmit_Interval_Unit_Code, TO_CHAR(R.Resubmit_End_Date, 'YYYY/MM/DD HH24:MI:SS'), Decode(E.Execution_File_Name, NULL, 'N', Decode(E.Subroutine_Name, NULL, Decode(E.Execution_Method_Code, 'I', 'Y', 'J', 'Y', 'N'), 'Y')), R.Argument1, R.Argument2, R.Argument3, R.Argument4, R.Argument5, R.Argument6, R.Argument7, R.Argument8, R.Argument9, R.Argument10, R.Argument11, R.Argument12, R.Argument13, R.Argument14, R.Argument15, R.Argument16, R.Argument17, R.Argument18, R.Argument19, R.Argument20, R.Argument21, R.Argument22, R.Argument23, R.Argument24, R.Argument25, X.Argument26, X.Argument27, X.Argument28, X.Argument29, X.Argument30, X.Argument31, X.Argument32, X.Argument33, X.Argument34, X.Argument35, X.Argument36, X.Argument3
7, X.Argument38, X.Argument39, X.Argument40, X.Argument41, X.Argument42, X.Argument43, X.Argument44, X.Argument45, X.Argument46, X.Argument47, X.Argument48, X.Argument49, X.Argument50, X.Argument51, X.Argument52, X.Argument53, X.Argument54, X.Argument55, X.Argument56, X.Argument57, X.Argument58, X.Argument59, X.Argument60, X.Argument61, X.Argument62, X.Argument63, X.Argument64, X.Argument65, X.Argument66, X.Argument67, X.Argument68, X.Argument69, X.Argument70, X.Argument71, X.Argument72, X.Argument73, X.Argument74, X.Argument75, X.Argument76, X.Argument77, X.Argument78, X.Argument79, X.Argument80, X.Argument81, X.Argument82, X.Argument83, X.Argument84, X.Argument85, X.Argument86, X.Argument87, X.Argument88, X.Argument89, X.Argument90, X.Argument91, X.Argument92, X.Argument93, X.Argument94, X.Argument95, X.Argument96, X.Argument97, X.Argument98, X.Argument99, X.Argument100, R.number_of_arguments, C.CD_Name, NVL(R.Security
_Group_ID, 0), NVL(R.org_id, -1) FROM fnd_concurrent_requests R, fnd_concurrent_programs P, fnd_application A, fnd_user U, fnd_oracle_userid O, fnd_conflicts_domain C, fnd_concurrent_queues Q, fnd_application A2, fnd_executables E, fnd_conc_request_arguments X WHERE R.Status_code = 'I' And (R.Edition_Name is null or R.Edition_Name <= sys_context('userenv', 'current_edition_name')) And R.Request_ID = X.Request_ID(+) And R.Program_Application_Id = P.Application_Id(+) And R.Concurrent_Program_Id = P.Concurrent_Program_Id(+) And R.Program_Application_Id = A.Application_Id(+) And P.Executable_Application_Id = E.Application_Id(+) And P.Executable_Id = E.Executable_Id(+) And P.Executable_Application_Id = A2.Application_Id(+) And R.Requested_By = U.User_Id(+) And R.Cd_Id = C.Cd_Id(+) And R.Oracle_Id = O.Oracle_Id(+) And Q.Application_Id = :q_applid And Q.Concurrent_Queue_Id = :queue_id And (P.Enabled_Flag is NULL OR P.Enabled_Flag = 'Y') And R.Hold_Flag = '
N' And R.Requested_Start_Date <= Sysdate And ( R.Enforce_Seriality_Flag = 'N' OR ( C.RunAlone_Flag = P.Run_Alone_Flag And (P.Run_Alone_Flag = 'N' OR Not Exists (Select Null From Fnd_Concurrent_Requests Sr Where Sr.Status_Code In ('R', 'T') And Sr.Enforce_Seriality_Flag = 'Y' And Sr.CD_id = C.CD_Id)))) And Q.Running_Processes <= Q.Max_Processes And R.Rowid = :reqname And ((P.Execution_Method_Code != 'S' OR (R.PROGRAM_APPLICATION_ID, R.CONCURRENT_PROGRAM_ID) IN ((0, 98), (0, 100), (0, 31721), (0, 31722), (0, 31757)))) AND ((R.PROGRAM_APPLICATION_ID, R.CONCURRENT_PROGRAM_ID) NOT IN ((510, 40032), (510, 40033), (510, 42156), (510, 42157), (530, 43793), (530, 43794), (535, 42626), (535, 42627), (535, 42628))) FOR UPDATE OF R.status_code NoWait |
4wgb411d8s7ss | INSERT INTO QP_NPREQ_LINE_ATTRS_TMP (LINE_INDEX, ATTRIBUTE_LEVEL, ATTRIBUTE_TYPE, CONTEXT, ATTRIBUTE, VALUE_FROM, VALIDATED_FLAG, APPLIED_FLAG, PRICING_STATUS_CODE, PRICING_ATTR_FLAG ) VALUES (:B1 , :B10 , :B2 , :B3 , :B4 , :B5 , :B6 , :B9 , :B8 , :B7 ) |
4yak7x2zqz0dh | BEGIN inv_transfer_order_pvt.finalize_pick_confirm(:1, :2, :3, :4, :5, :6, :7); END; |
521y9hsruj6y2 | SELECT I.TAX_CODE FROM ZX_OUTPUT_CLASSIFICATIONS_V L, MTL_SYSTEM_ITEMS I WHERE I.INVENTORY_ITEM_ID = :B4 AND I.ORGANIZATION_ID = :B3 AND L.LOOKUP_CODE = I.TAX_CODE AND L.ORG_ID IN (:B2 , -99) AND L.ENABLED_FLAG = 'Y' AND (L.START_DATE_ACTIVE <= :B1 OR L.START_DATE_ACTIVE IS NULL) AND (L.END_DATE_ACTIVE >= :B1 OR L.END_DATE_ACTIVE IS NULL) AND ROWNUM = 1 ORDER BY L.ORG_ID DESC |
5a13j7f3jw28r |
UPDATE OE_ORDER_LINES SET ACCOUNTING_RULE_ID = :B354 , ACCOUNTING_RULE_DURATION = :B353 , CALCULATE_PRICE_FLAG = :B352 , ACTUAL_ARRIVAL_DATE = :B351 , ACTUAL_SHIPMENT_DATE = :B350 , AGREEMENT_ID = :B349 , ARRIVAL_SET_ID = :B348 , ATO_LINE_ID = :B347 , ATTRIBUTE1 = :B346 , ATTRIBUTE10 = :B345 , ATTRIBUTE11 = :B344 , ATTRIBUTE12 = :B343 , ATTRIBUTE13 = :B342 , ATTRIBUTE14 = :B341 , ATTRIBUTE15 = :B340 , ATTRIBUTE16 = :B339 , ATTRIBUTE17 = :B338 , ATTRIBUTE18 = :B337 , ATTRIBUTE19 = :B336 , ATTRIBUTE2 = :B335 , ATTRIBUTE20 = :B334 , ATTRIBUTE3 = :B333 , ATTRIBUTE4 = :B332 , ATTRIBUTE5 = :B331 , ATTRIBUTE6 = :B330 , ATTRIBUTE7 = :B329 , ATTRIBUTE8 = :B328 , ATTRIBUTE9 = :B327 , AUTO_SELECTED_QUANTITY = :B326 , AUTHORIZED_TO_SHIP_FLAG = :B325 , BOOKED_FLAG = :B324 , CANCELLED_FLAG = :B323 , CANCELLED_QUANTITY = :B322 , COMMITMENT_ID = :B321 , COMPONENT_CODE = :B320 , COMPONENT_SEQUENCE_ID = :B319 , CONFIG_HEADER_ID = :B318 , CONFIG_REV_NBR = :B317 , CON
FIG_DISPLAY_SEQUENCE = :B316 , CONFIGURATION_ID = :B315 , CONTEXT = :B314 , CREATED_BY = :B313 , CREATION_DATE = :B312 , CREDIT_INVOICE_LINE_ID = :B311 , CUSTOMER_LINE_NUMBER = :B310 , CUSTOMER_SHIPMENT_NUMBER = :B309 , CUSTOMER_ITEM_NET_PRICE = :B308 , CUSTOMER_PAYMENT_TERM_ID = :B307 , CUSTOMER_DOCK_CODE = :B306 , CUSTOMER_JOB = :B305 , CUSTOMER_PRODUCTION_LINE = :B304 , CUST_PRODUCTION_SEQ_NUM = :B303 , CUSTOMER_TRX_LINE_ID = :B302 , CUST_MODEL_SERIAL_NUMBER = :B301 , CUST_PO_NUMBER = :B300 , DELIVERY_LEAD_TIME = :B299 , DELIVER_TO_CONTACT_ID = :B298 , DELIVER_TO_ORG_ID = :B297 , DEMAND_BUCKET_TYPE_CODE = :B296 , DEMAND_CLASS_CODE = :B295 , DEP_PLAN_REQUIRED_FLAG = :B294 , EARLIEST_ACCEPTABLE_DATE = :B293 , END_ITEM_UNIT_NUMBER = :B292 , EXPLOSION_DATE = :B291 , FIRST_ACK_CODE = :B290 , FIRST_ACK_DATE = :B289 , FOB_POINT_CODE = :B288 , FREIGHT_CARRIER_CODE = :B287 , FREIGHT_TERMS_CODE = :B286 , FULFILLED_QUANTITY = :B285 , FULFILLED_FLAG = :B284 , FU
LFILLMENT_METHOD_CODE = :B283 , FULFILLMENT_DATE = :B282 , GLOBAL_ATTRIBUTE1 = :B281 , GLOBAL_ATTRIBUTE10 = :B280 , GLOBAL_ATTRIBUTE11 = :B279 , GLOBAL_ATTRIBUTE12 = :B278 , GLOBAL_ATTRIBUTE13 = :B277 , GLOBAL_ATTRIBUTE14 = :B276 , GLOBAL_ATTRIBUTE15 = :B275 , GLOBAL_ATTRIBUTE16 = :B274 , GLOBAL_ATTRIBUTE17 = :B273 , GLOBAL_ATTRIBUTE18 = :B272 , GLOBAL_ATTRIBUTE19 = :B271 , GLOBAL_ATTRIBUTE2 = :B270 , GLOBAL_ATTRIBUTE20 = :B269 , GLOBAL_ATTRIBUTE3 = :B268 , GLOBAL_ATTRIBUTE4 = :B267 , GLOBAL_ATTRIBUTE5 = :B266 , GLOBAL_ATTRIBUTE6 = :B265 , GLOBAL_ATTRIBUTE7 = :B264 , GLOBAL_ATTRIBUTE8 = :B263 , GLOBAL_ATTRIBUTE9 = :B262 , GLOBAL_ATTRIBUTE_CATEGORY = :B261 , HEADER_ID = :B1 , INDUSTRY_ATTRIBUTE1 = :B260 , INDUSTRY_ATTRIBUTE10 = :B259 , INDUSTRY_ATTRIBUTE11 = :B258 , INDUSTRY_ATTRIBUTE12 = :B257 , INDUSTRY_ATTRIBUTE13 = :B256 , INDUSTRY_ATTRIBUTE14 = :B255 , INDUSTRY_ATTRIBUTE15 = :B254 , INDUSTRY_ATTRIBUTE16 = :B253 , INDUSTRY_ATTRIBUTE17 = :B252 , INDUS
TRY_ATTRIBUTE18 = :B251 , INDUSTRY_ATTRIBUTE19 = :B250 , INDUSTRY_ATTRIBUTE20 = :B249 , INDUSTRY_ATTRIBUTE21 = :B248 , INDUSTRY_ATTRIBUTE22 = :B247 , INDUSTRY_ATTRIBUTE23 = :B246 , INDUSTRY_ATTRIBUTE24 = :B245 , INDUSTRY_ATTRIBUTE25 = :B244 , INDUSTRY_ATTRIBUTE26 = :B243 , INDUSTRY_ATTRIBUTE27 = :B242 , INDUSTRY_ATTRIBUTE28 = :B241 , INDUSTRY_ATTRIBUTE29 = :B240 , INDUSTRY_ATTRIBUTE30 = :B239 , INDUSTRY_ATTRIBUTE2 = :B238 , INDUSTRY_ATTRIBUTE3 = :B237 , INDUSTRY_ATTRIBUTE4 = :B236 , INDUSTRY_ATTRIBUTE5 = :B235 , INDUSTRY_ATTRIBUTE6 = :B234 , INDUSTRY_ATTRIBUTE7 = :B233 , INDUSTRY_ATTRIBUTE8 = :B232 , INDUSTRY_ATTRIBUTE9 = :B231 , INDUSTRY_CONTEXT = :B230 , INTMED_SHIP_TO_CONTACT_ID = :B229 , INTMED_SHIP_TO_ORG_ID = :B228 , INVENTORY_ITEM_ID = :B227 , INVOICE_INTERFACE_STATUS_CODE = :B226 , INVOICE_TO_CONTACT_ID = :B225 , INVOICE_TO_ORG_ID = :B224 , INVOICED_QUANTITY = :B223 , INVOICING_RULE_ID = :B222 , ORDERED_ITEM_ID = :B221 , ITEM_IDENTIFIER_TYPE = :B2
20 , ORDERED_ITEM = :B219 , ITEM_REVISION = :B218 , ITEM_TYPE_CODE = :B217 , LAST_ACK_CODE = :B216 , LAST_ACK_DATE = :B215 , LAST_UPDATED_BY = :B214 , LATEST_ACCEPTABLE_DATE = :B213 , LAST_UPDATE_DATE = :B212 , LAST_UPDATE_LOGIN = :B211 , LINE_CATEGORY_CODE = :B210 , LINE_NUMBER = :B209 , LINE_TYPE_ID = :B208 , LINK_TO_LINE_ID = :B207 , MODEL_GROUP_NUMBER = :B206 , MFG_LEAD_TIME = :B205 , OPEN_FLAG = :B204 , OPTION_FLAG = :B203 , OPTION_NUMBER = :B202 , ORDERED_QUANTITY = :B201 , ORDERED_QUANTITY2 = :B200 , ORDER_QUANTITY_UOM = :B199 , ORDERED_QUANTITY_UOM2 = :B198 , ORDER_SOURCE_ID = :B197 , ORIG_SYS_DOCUMENT_REF = :B196 , ORIG_SYS_LINE_REF = :B195 , ORIG_SYS_SHIPMENT_REF = :B194 , CHANGE_SEQUENCE = :B193 , OVER_SHIP_REASON_CODE = :B192 , OVER_SHIP_RESOLVED_FLAG = :B191 , PAYMENT_TERM_ID = :B190 , PLANNING_PRIORITY = :B189 , PREFERRED_GRADE = :B188 , PRICE_LIST_ID = :B187 , PRICE_REQUEST_CODE = :B186 , PRICING_ATTRIBUTE1 = :B185 , PRICING_ATTRIBUTE1
0 = :B184 , PRICING_ATTRIBUTE2 = :B183 , PRICING_ATTRIBUTE3 = :B182 , PRICING_ATTRIBUTE4 = :B181 , PRICING_ATTRIBUTE5 = :B180 , PRICING_ATTRIBUTE6 = :B179 , PRICING_ATTRIBUTE7 = :B178 , PRICING_ATTRIBUTE8 = :B177 , PRICING_ATTRIBUTE9 = :B176 , PRICING_CONTEXT = :B175 , PRICING_DATE = :B174 , PRICING_QUANTITY = :B173 , PRICING_QUANTITY_UOM = :B172 , PROGRAM_APPLICATION_ID = :B171 , PROGRAM_ID = :B170 , PROGRAM_UPDATE_DATE = :B169 , PROJECT_ID = :B168 , PROMISE_DATE = :B167 , RE_SOURCE_FLAG = :B166 , REFERENCE_CUSTOMER_TRX_LINE_ID = :B165 , REFERENCE_HEADER_ID = :B164 , REFERENCE_LINE_ID = :B163 , REFERENCE_TYPE = :B162 , REQUEST_DATE = :B161 , REQUEST_ID = :B160 , RETURN_ATTRIBUTE1 = :B159 , RETURN_ATTRIBUTE10 = :B158 , RETURN_ATTRIBUTE11 = :B157 , RETURN_ATTRIBUTE12 = :B156 , RETURN_ATTRIBUTE13 = :B155 , RETURN_ATTRIBUTE14 = :B154 , RETURN_ATTRIBUTE15 = :B153 , RETURN_ATTRIBUTE2 = :B152 , RETURN_ATTRIBUTE3 = :B151 , RETURN_ATTRIBUTE4 = :B150 , RETURN_
ATTRIBUTE5 = :B149 , RETURN_ATTRIBUTE6 = :B148 , RETURN_ATTRIBUTE7 = :B147 , RETURN_ATTRIBUTE8 = :B146 , RETURN_ATTRIBUTE9 = :B145 , RETURN_CONTEXT = :B144 , RETURN_REASON_CODE = :B143 , RLA_SCHEDULE_TYPE_CODE = :B142 , SALESREP_ID = :B141 , SCHEDULE_ARRIVAL_DATE = :B140 , SCHEDULE_SHIP_DATE = :B139 , SCHEDULE_STATUS_CODE = :B138 , SHIPMENT_NUMBER = :B137 , SHIPMENT_PRIORITY_CODE = :B136 , SHIPPED_QUANTITY = :B135 , SHIPPED_QUANTITY2 = :B134 , SHIPPING_METHOD_CODE = :B133 , SHIPPING_QUANTITY = :B132 , SHIPPING_QUANTITY2 = :B131 , SHIPPING_QUANTITY_UOM = :B130 , SHIP_FROM_ORG_ID = :B129 , SUBINVENTORY = :B128 , SHIP_TOLERANCE_ABOVE = :B127 , SHIP_TOLERANCE_BELOW = :B126 , SHIPPABLE_FLAG = :B125 , SHIPPING_INTERFACED_FLAG = :B124 , SHIP_TO_CONTACT_ID = :B123 , SHIP_TO_ORG_ID = :B122 , SHIP_MODEL_COMPLETE_FLAG = :B121 , SHIP_SET_ID = :B120 , SOLD_TO_ORG_ID = :B119 , SOLD_FROM_ORG_ID = :B118 , SORT_ORDER = :B117 , SOURCE_DOCUMENT_ID = :B116 , SOURCE_DOCUME
NT_LINE_ID = :B115 , SOURCE_DOCUMENT_TYPE_ID = :B114 , SOURCE_TYPE_CODE = :B113 , SPLIT_FROM_LINE_ID = :B112 , LINE_SET_ID = :B111 , SPLIT_BY = :B110 , MODEL_REMNANT_FLAG = :B109 , TASK_ID = :B108 , TAX_CODE = :B107 , TAX_DATE = :B106 , TAX_EXEMPT_FLAG = :B105 , TAX_EXEMPT_NUMBER = :B104 , TAX_EXEMPT_REASON_CODE = :B103 , TAX_POINT_CODE = :B102 , TAX_RATE = :B101 , TAX_VALUE = :B100 , TOP_MODEL_LINE_ID = :B99 , UNIT_LIST_PRICE = :B98 , UNIT_LIST_PRICE_PER_PQTY = :B97 , UNIT_SELLING_PRICE = :B96 , UNIT_SELLING_PRICE_PER_PQTY = :B95 , VISIBLE_DEMAND_FLAG = :B94 , VEH_CUS_ITEM_CUM_KEY_ID = :B93 , SHIPPING_INSTRUCTIONS = :B92 , PACKING_INSTRUCTIONS = :B91 , SERVICE_TXN_REASON_CODE = :B90 , SERVICE_TXN_COMMENTS = :B89 , SERVICE_DURATION = :B88 , SERVICE_PERIOD = :B87 , SERVICE_START_DATE = :B86 , SERVICE_END_DATE = :B85 , SERVICE_COTERMINATE_FLAG = :B84 , UNIT_LIST_PERCENT = :B83 , UNIT_SELLING_PERCENT = :B82 , UNIT_PERCENT_BASE_PRICE = :B81 , SERVICE_NUMB
ER = :B80 , SERVICE_REFERENCE_TYPE_CODE = :B79 , SERVICE_REFERENCE_LINE_ID = :B78 , SERVICE_REFERENCE_SYSTEM_ID = :B77 , TP_CONTEXT = :B76 , TP_ATTRIBUTE1 = :B75 , TP_ATTRIBUTE2 = :B74 , TP_ATTRIBUTE3 = :B73 , TP_ATTRIBUTE4 = :B72 , TP_ATTRIBUTE5 = :B71 , TP_ATTRIBUTE6 = :B70 , TP_ATTRIBUTE7 = :B69 , TP_ATTRIBUTE8 = :B68 , TP_ATTRIBUTE9 = :B67 , TP_ATTRIBUTE10 = :B66 , TP_ATTRIBUTE11 = :B65 , TP_ATTRIBUTE12 = :B64 , TP_ATTRIBUTE13 = :B63 , TP_ATTRIBUTE14 = :B62 , TP_ATTRIBUTE15 = :B61 , FLOW_STATUS_CODE = :B60 , MARKETING_SOURCE_CODE_ID = :B59 , ORIGINAL_INVENTORY_ITEM_ID = :B58 , ORIGINAL_ITEM_IDENTIFIER_TYPE = :B57 , ORIGINAL_ORDERED_ITEM_ID = :B56 , ORIGINAL_ORDERED_ITEM = :B55 , ITEM_RELATIONSHIP_TYPE = :B54 , ITEM_SUBSTITUTION_TYPE_CODE = :B53 , LATE_DEMAND_PENALTY_FACTOR = :B52 , OVERRIDE_ATP_DATE_CODE = :B51 , FIRM_DEMAND_FLAG = :B50 , EARLIEST_SHIP_DATE = :B49 , USER_ITEM_DESCRIPTION = :B48 , BLANKET_NUMBER = :B47 , BLANKET_LINE_NUMBER = :B46 ,
BLANKET_VERSION_NUMBER = :B45 , UNIT_COST = :B44 , LOCK_CONTROL = :B43 , TRANSACTION_PHASE_CODE = :B42 , SOURCE_DOCUMENT_VERSION_NUMBER = :B41 , MINISITE_ID = :B40 , IB_OWNER = :B39 , IB_INSTALLED_AT_LOCATION = :B38 , IB_CURRENT_LOCATION = :B37 , END_CUSTOMER_ID = :B36 , END_CUSTOMER_CONTACT_ID = :B35 , END_CUSTOMER_SITE_USE_ID = :B34 , RETROBILL_REQUEST_ID = :B33 , ORIGINAL_LIST_PRICE = :B32 , ORDER_FIRMED_DATE = :B31 , ACTUAL_FULFILLMENT_DATE = :B30 , CHARGE_PERIODICITY_CODE = :B29 , CANCELLED_QUANTITY2 = :B28 , SHIPPING_QUANTITY_UOM2 = :B27 , FULFILLED_QUANTITY2 = :B26 , CONTINGENCY_ID = :B25 , REVREC_EVENT_CODE = :B24 , REVREC_EXPIRATION_DAYS = :B23 , ACCEPTED_QUANTITY = :B22 , REVREC_COMMENTS = :B21 , REVREC_SIGNATURE = :B20 , REVREC_SIGNATURE_DATE = :B19 , ACCEPTED_BY = :B18 , REVREC_REFERENCE_DOCUMENT = :B17 , REVREC_IMPLICIT_FLAG = :B16 , SERVICE_BILL_PROFILE_ID = :B15 , SERVICE_COV_TEMPLATE_ID = :B14 , SERVICE_SUBS_TEMPLATE_ID = :B13 , SERVIC
E_BILL_OPTION_CODE = :B12 , SUBSCRIPTION_ENABLE_FLAG = :B11 , SERVICE_FIRST_PERIOD_AMOUNT = :B10 , SERVICE_FIRST_PERIOD_ENDDATE = :B9 , FULFILLMENT_BASE = :B8 , CONTAINER_NUMBER = :B7 , EQUIPMENT_ID = :B6 , REQUIRE_BILLING_VALIDATION =:B5 , BILLING_PLAN_HEADER_ID =:B4 , SOURCE_ORDER_LINE_ID =:B3 WHERE LINE_ID = :B2 AND HEADER_ID = :B1 |
5hkusby2vv4pk | SELECT SUM(NVL(ACCTD_AMOUNT_DUE_REMAINING, 0)) , SUM(NVL(AMOUNT_DUE_REMAINING, 0)) FROM AR_PAYMENT_SCHEDULES PS, AR_SYSTEM_PARAMETERS PARM WHERE CUSTOMER_ID = :B1 AND PS.ORG_ID = PARM.ORG_ID AND PS.STATUS = 'OP' |
5uc22nkkupb6x | SELECT INVENTORY_ITEM_ID , ORGANIZATION_ID , INVOICING_RULE_ID , ACCOUNTING_RULE_ID , DEFAULT_SHIPPING_ORG , SHIP_MODEL_COMPLETE_FLAG , BUILD_IN_WIP_FLAG , BOM_ITEM_TYPE , REPLENISH_TO_ORDER_FLAG , PRIMARY_UOM_CODE , PICK_COMPONENTS_FLAG , SHIPPABLE_ITEM_FLAG , SERVICE_ITEM_FLAG , ORGANIZATION_ID , CUSTOMER_ORDER_ENABLED_FLAG , INTERNAL_ORDER_ENABLED_FLAG , RETURNABLE_FLAG , RESTRICT_SUBINVENTORIES_CODE FROM MTL_SYSTEM_ITEMS WHERE INVENTORY_ITEM_ID = :B2 AND ORGANIZATION_ID = OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID', :B1 ) |
616m6uhpa2usu | select i.obj#, i.ts#, i.file#, i.block#, i.intcols, i.type#, i.flags, i.property, i.pctfree$, i.initrans, i.maxtrans, i.blevel, i.leafcnt, i.distkey, i.lblkkey, i.dblkkey, i.clufac, i.cols, i.analyzetime, i.samplesize, i.dataobj#, nvl(i.degree, 1), nvl(i.instances, 1), i.rowcnt, mod(i.pctthres$, 256), i.indmethod#, i.trunccnt, nvl(c.unicols, 0), nvl(c.deferrable#+c.valid#, 0), nvl(i.spare1, i.intcols), i.spare4, i.spare2, i.spare6, decode(i.pctthres$, null, null, mod(trunc(i.pctthres$/256), 256)), nvl(i.evaledition#, 1), nvl(i.unusablebefore#, 0), nvl(i.unusablebeginning#, 0), ist.cachedblk, ist.cachehit, ist.logicalread from ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols, min(to_number(bitand(defer, 1))) deferrable#, min(to_number(bitand(defer, 4))) valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj# |
6a0xty1ja4gtk | SELECT NVL(ORDR_TYPE.CREDIT_CARD_REV_REAUTH_CODE, OE_SYS_PARAMETERS.VALUE('OE_CC_REVERSAL_REAUTHORIZATION')) FROM OE_ORDER_HEADERS_ALL ORDR , OE_TRANSACTION_TYPES_ALL ORDR_TYPE WHERE ORDR.ORDER_TYPE_ID = ORDR_TYPE.TRANSACTION_TYPE_ID AND ORDR.HEADER_ID = :B1 |
6dhn7dz44apb9 | begin OE_SCHEDULE_UTIL.IS_ITEM_SUBSTITUTED( :t_application_id, :t_entity_short_name, :t_validation_entity_short_name, :t_validation_tmplt_short_name, :t_record_set_short_name, :t_scope, :t_result ); end; |
6dp3t6txwjvam | SELECT SU.TAX_CODE FROM HZ_CUST_SITE_USES_ALL SU, ZX_OUTPUT_CLASSIFICATIONS_V L WHERE SU.SITE_USE_ID = :B3 AND SU.ORG_ID = :B2 AND L.LOOKUP_CODE = SU.TAX_CODE AND L.ORG_ID IN (:B2 , -99) AND L.ENABLED_FLAG = 'Y' AND (L.START_DATE_ACTIVE <= :B1 OR L.START_DATE_ACTIVE IS NULL) AND (L.END_DATE_ACTIVE >= :B1 OR L.END_DATE_ACTIVE IS NULL) AND ROWNUM = 1 ORDER BY L.ORG_ID DESC |
707cda24y439k | SELECT NVL(count(1), 0), NVL(SUM(ACCTD_AMOUNT_DUE_REMAINING), 0)
FROM ar_payment_schedules arp
WHERE (arp.customer_id = :cust_account_id
and arp.status = 'OP')
and
(
trunc(sysdate)-trunc(arp.due_date) >= :days_start
and trunc(sysdate)-trunc(arp.due_date) <= :days_to
and arp.class = :class
) |
7umy6juhzw766 | select /*+ connect_by_filtering index(sysauth$ i_sysauth1) */ privilege#, bitand(nvl(option$, 0), 8), grantee#, level from sysauth$ connect by grantee#=prior privilege# and privilege#>0 start with grantee#=:1 and privilege#>0 |
7z0tsy9zxk6p0 | SELECT count(distinct ocahb.id)
FROM ar_payment_schedules arp,
ar_aging_bucket_lines aabl,
ra_customer_trx rct,
okl_cnsld_ar_strms_b ocasb,
OKL_CNSLD_AR_LINES_B ocalb,
OKL_CNSLD_AR_HDRS_B ocahb
WHERE (:l_date - arp.due_date) >= aabl.days_start
and (:l_date - arp.due_date) <= aabl.days_to
and arp.class = :l_class
and rct.customer_trx_id = arp.customer_trx_id
and ocasb.receivables_invoice_id = rct.customer_trx_id
and ocalb.id = ocasb.lln_id
and ocahb.id = ocalb.cnr_id
and rct.interface_header_attribute9 <> :l_interface_attr
and rct.interface_header_context = :l_interface_context
and arp.status = :l_status
and aabl.aging_bucket_line_id = :bucket_line_id
AND arp.customer_id = :cust_account_id |
80k1jcpz5surw | SELECT SUM(ACCTD_AMOUNT_DUE_REMAINING) AMOUNT , SUM(AMOUNT_DUE_REMAINING) FROM AR_PAYMENT_SCHEDULES PS, IEX_DELINQUENCIES DEL WHERE PS.CUSTOMER_ID = :B1 AND PS.STATUS = 'OP' AND DEL.PAYMENT_SCHEDULE_ID = PS.PAYMENT_SCHEDULE_ID AND DEL.STATUS IN ('DELINQUENT', 'PREDELINQUENT') |
89nx1vrqtn1q7 |
SELECT /*+ no_monitor */ CON_ID, OBJOID, CLSOID, DECODE(BITAND(FLAGS, 16384), 0, RUNTIME, LETIME), (2*PRI + DECODE(BITAND(STATUS, 4), 0, 0, decode(INST, :1, -1, 1))), JOBTYPE, SCHLIM, WT, INST, RUNNOW, ENQ_SCHLIM, INST_ID FROM ( select nvl(a.con_id, 0) CON_ID, a.obj# OBJOID, a.class_oid CLSOID, a.next_run_date RUNTIME, a.last_enabled_time LETIME, a.flags FLAGS, a.job_status STATUS, 1 JOBTYPE, a.priority PRI, decode(a.schedule_limit, NULL, decode(bitand(a.flags, 4194304), 4194304, b.schedule_limit, NULL), a.schedule_limit) SCHLIM, a.job_weight WT, decode(a.running_instance, NULL, 0, a.running_instance) INST, decode(bitand(a.flags, 16384), 0, 0, 1) RUNNOW, decode(bitand(a.job_status, 8388608), 0, 0, 1) ENQ_SCHLIM, a.instance_id INST_ID from (select ta.con_id, ta.obj#, ta.class
_oid, ta.next_run_date, ta.flags, ta.priority, ta.job_status, ta.instance_id, ta.running_instance, ta.job_weight, ta.schedule_limit, ta.last_enabled_time, ta.database_role, ta.program_oid from sys.scheduler$_cdb_job ta , sys.scheduler$_cdb_class e where (ta.next_run_date <= :2 OR BITAND(ta.flags, 16384) <> 0) and ta.class_oid=e.obj#(+) and ((ta.class_oid is not null and ta.instance_id is null and (bitand(e.flags, :3) <> 0 and lower(e.affinity) = lower(:4) and nvl(e.con_id, 0) = nvl(ta.con_id, 0) and lower(e.affinity) not in (select name from cdb_service$ where bitand(flags, 128) = 128)) ) or ta.instance_id is not null and ta.instance_id = :5 ) ) a, sys.scheduler$_cdb_program b, v$database v , v$instance i where a.program_oid = b.obj#(+) and (b.con_id is NULL or (nvl(a.con_id, 0) = nvl(b.con_id, 0))) and ( (a.database_role = v.d
atabase_role) or (a.database_role = 'ALL') or (a.database_role is null and v.database_role = 'PRIMARY') ) and (v.guard_status <> 'ALL' or a.database_role = 'ALL') and ( i.logins = 'ALLOWED' or bitand(a.flags, 17179869184) <> 0 ) union all select nvl(c.con_id, 0), c.obj#, c.class_oid, c.next_run_date, c.last_enabled_time, c.flags, c.job_status, 1, decode(bitand(c.flags, 8589934592), 0, d.priority, pj.priority), decode(bitand(c.flags, 8589934592), 0, d.schedule_limit, decode(pj.schedule_limit, NULL, d.schedule_limit, pj.schedule_limit)), decode(bitand(c.flags, 8589934592), 0, d.job_weight, pj.job_weight), decode(c.running_instance, NULL, 0, c.running_instance), decode(bitand(c.flags, 16384), 0, 0, 1) RUNNOW, decode(bitand(c.job_status, 8388608), 0, 0, 1) ENQ_SCHLIM, c.instance_id INST_ID from sys.scheduler$_cdb_comb_lw_job c,
sys.scheduler$_cdb_program d, (select nvl(sl.con_id, 0) con_id, sl.obj# obj#, decode(bitand(sl.flags, 8589934592), 0, sl.program_oid, spj.program_oid) program_oid, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.priority) priority, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.job_weight) job_weight, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.schedule_limit) schedule_limit from (select ta.con_id, ta.obj#, ta.class_oid, ta.next_run_date, ta.flags, ta.job_status, ta.instance_id, ta.running_instance, ta.last_enabled_time, ta.program_oid from sys.scheduler$_cdb_comb_lw_job ta, sys.scheduler$_cdb_class e where (ta.next_run_date <= :6 OR BITAND(ta.flags, 16384) <> 0) and ta.class_oid=e.obj#(+) and ((ta.class_oid is not null and ta.instance_id is null and
(bitand(e.flags, :7) <> 0 and lower(e.affinity) = lower(:8) and nvl(e.con_id, 0) = nvl(ta.con_id, 0) and lower(e.affinity) not in (select name from cdb_service$ where bitand(flags, 128) = 128)) ) or ta.instance_id is not null and ta.instance_id = :9 ) ) sl, scheduler$_cdb_job spj where sl.program_oid = spj.obj#(+) and (spj.con_id is NULL or (nvl(sl.con_id, 0) = nvl(spj.con_id, 0)))) pj, v$instance i where pj.obj# = c.obj# and pj.program_oid = d.obj#(+) and (pj.con_id is NULL or (nvl(c.con_id, 0) = nvl(pj.con_id, 0))) and (d.con_id is NULL or (nvl(c.con_id, 0) = nvl(d.con_id, 0))) and ( i.logins = 'ALLOWED' or bitand(c.flags, 17179869184) <> 0 ) and (:10 = 0 or c.running_instance = :11)) m WHERE BITAND(STATUS, 515) = 1 AND BITAND(FLAGS, 1048576) = 0 AND ((BITAND(FLAGS, 134217728 + 268435456) = 0) OR (BITAND(STATUS, 1024) <> 0)) AND BITAND(FLAGS, 4096) = 0
ORDER BY 4, 3, 5, 8 DESC, 2 |
8camsgjsr9zya | begin OE_TRANSACTION_TYPES_PKG.Val_Ord_Change( :t_application_id, :t_entity_short_name, :t_validation_entity_short_name, :t_validation_tmplt_short_name, :t_record_set_short_name, :t_scope, :t_result ); end; |
8qn2s8n8ayxvr |
SELECT /*+ no_monitor */ CON_ID, OBJOID, CLSOID, DECODE(BITAND(FLAGS, 16384), 0, RUNTIME, LETIME), (2*PRI + DECODE(BITAND(STATUS, 4), 0, 0, decode(INST, :1, -1, 1))), JOBTYPE, SCHLIM, WT, INST, RUNNOW, ENQ_SCHLIM, INST_ID, SRVNAME FROM ( select nvl(a.con_id, 0) CON_ID, a.obj# OBJOID, a.class_oid CLSOID, a.next_run_date RUNTIME, a.last_enabled_time LETIME, a.flags FLAGS, a.job_status STATUS, 1 JOBTYPE, a.priority PRI, decode(a.schedule_limit, NULL, decode(bitand(a.flags, 4194304), 4194304, b.schedule_limit, NULL), a.schedule_limit) SCHLIM, a.job_weight WT, decode(a.running_instance, NULL, 0, a.running_instance) INST, decode(bitand(a.flags, 16384), 0, 0, 1) RUNNOW, decode(bitand(a.job_status, 8388608), 0, 0, 1) ENQ_SCHLIM, a.instance_id INST_ID , a.affinity SRVNAME from (selec
t ta.con_id, ta.obj#, ta.class_oid, ta.next_run_date, ta.flags, ta.priority, ta.job_status, ta.instance_id, ta.running_instance, ta.job_weight, ta.schedule_limit, ta.last_enabled_time, ta.database_role, ta.program_oid, e.affinity from sys.scheduler$_cdb_job ta, sys.scheduler$_cdb_class e where (ta.next_run_date <= :2 OR BITAND(ta.flags, 16384) <> 0) and ta.class_oid=e.obj#(+) and ((ta.class_oid is not null and ta.instance_id is null and (bitand(e.flags, :3) <> 0 and (lower(e.affinity) = lower(:4) or lower(e.affinity) in (select name from cdb_service$ where bitand(flags, 128) = 128)) and nvl(e.con_id, 0) = nvl(ta.con_id, 0) ) ) or ta.instance_id is not null and ta.instance_id = :5 ) ) a, sys.scheduler$_cdb_program b, v$database v , v$instance i where a.program_oid = b.obj#(+) and (b.con_id is NULL or (nvl(a.con_id, 0) = nv
l(b.con_id, 0))) and ( (a.database_role = v.database_role) or (a.database_role = 'ALL') or (a.database_role is null and v.database_role = 'PRIMARY') ) and (v.guard_status <> 'ALL' or a.database_role = 'ALL') and ( i.logins = 'ALLOWED' or bitand(a.flags, 17179869184) <> 0 ) union all select nvl(c.con_id, 0), c.obj#, c.class_oid, c.next_run_date, c.last_enabled_time, c.flags, c.job_status, 1, decode(bitand(c.flags, 8589934592), 0, d.priority, pj.priority), decode(bitand(c.flags, 8589934592), 0, d.schedule_limit, decode(pj.schedule_limit, NULL, d.schedule_limit, pj.schedule_limit)), decode(bitand(c.flags, 8589934592), 0, d.job_weight, pj.job_weight), decode(c.running_instance, NULL, 0, c.running_instance), decode(bitand(c.flags, 16384), 0, 0, 1) RUNNOW, decode(bitand(c.job_status, 8388608), 0, 0, 1) ENQ_SCHLIM, c.instance_id
INST_ID, pj.affinity from sys.scheduler$_cdb_comb_lw_job c, sys.scheduler$_cdb_program d, (select nvl(sl.con_id, 0) con_id, sl.obj# obj#, decode(bitand(sl.flags, 8589934592), 0, sl.program_oid, spj.program_oid) program_oid, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.priority) priority, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.job_weight) job_weight, decode(bitand(sl.flags, 8589934592), 0, NULL, spj.schedule_limit) schedule_limit, sl.affinity from (select ta.con_id, ta.obj#, ta.class_oid, ta.next_run_date, ta.flags, ta.job_status, ta.instance_id, ta.running_instance, ta.last_enabled_time, ta.program_oid , e.affinity from sys.scheduler$_cdb_comb_lw_job ta, sys.scheduler$_cdb_class e where (ta.next_run_date <= :6 OR BITAND(ta.flags, 16384) <> 0) and
ta.class_oid=e.obj#(+) and ((ta.class_oid is not null and ta.instance_id is null and (bitand(e.flags, :7) <> 0 and (lower(e.affinity) = lower(:8) or lower(e.affinity) in (select name from cdb_service$ where bitand(flags, 128) = 128)) and nvl(e.con_id, 0) = nvl(ta.con_id, 0) ) ) or ta.instance_id is not null and ta.instance_id = :9 ) ) sl, scheduler$_cdb_job spj where sl.program_oid = spj.obj#(+) and (spj.con_id is NULL or (nvl(sl.con_id, 0) = nvl(spj.con_id, 0)))) pj, v$instance i where pj.obj# = c.obj# and pj.program_oid = d.obj#(+) and (pj.con_id is NULL or (nvl(c.con_id, 0) = nvl(pj.con_id, 0))) and (d.con_id is NULL or (nvl(c.con_id, 0) = nvl(d.con_id, 0))) and ( i.logins = 'ALLOWED' or bitand(c.flags, 17179869184) <> 0 ) and (:10 = 0 or c.running_instance = :11)) m WHERE BITAND(STATUS, 515) = 1 AND BITAND(FLAGS, 1048576) = 0 AND ((BITAND(FLAGS, 134217728 + 268
435456) = 0) OR (BITAND(STATUS, 1024) <> 0)) AND BITAND(FLAGS, 4096) = 0 ORDER BY 4, 3, 5, 8 DESC, 2 |
a2spudc4ty57x | SELECT /* $Header: fdfdfu.lc 120.32.12020000.18 2016/08/19 18:37:23 tebarnes ship $ */ descriptive_flex_context_code FROM fnd_descr_flex_contexts_vl WHERE application_id = :applid AND descriptive_flexfield_name = :dflex_name AND descriptive_flex_context_name = :refctx_name AND enabled_flag = 'Y' |
abmd29pj098a0 | SELECT SUM(PRIMARY_RESERVATION_QUANTITY) , SUM(SECONDARY_RESERVATION_QUANTITY) FROM MTL_RESERVATIONS WHERE ORGANIZATION_ID = :B3 AND INVENTORY_ITEM_ID = :B2 AND SUPPLY_SOURCE_TYPE_ID <> :B1 AND DEMAND_SOURCE_LINE_DETAIL IS NULL |
anjk02y9d63y4 |
SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(qpq QP_QUALIFIERS_N7) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ
.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.QUALIFIER_ATTR_VALUE = QPLATQ.VALUE_FROM AND QPQ.COMPARISON_OPERATOR_CODE = '=' AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND ( QPQ.LIST_HEADER_ID IN (SELECT /*+ no_unnest push_subq index
(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_PHASE_ID = :B8 AND PRICING_STATUS_CODE = :B3 )) AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END
_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(QPQ QP_QUALIFIERS_N4) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG
, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE
_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.QUALIFIER_ATTR_VALUE = QPLATQ.VALUE_FROM AND QPQ.COMPARISON_OPERATOR_CODE = '=' AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND QPQ.HEADER_QUALS_EXIST_FLAG = :B9 AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHER
E C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2
AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(qpq QP_QUALIFIERS_N7) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPL
ATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATT
RIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B17 AND QPQ.QUALIFIER_DATATYPE = :B16 AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND ( QPQ.LIST_HEADER_ID IN (SELECT /*+ no_unnest push_subq index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_PHASE_ID = :B8 AND PRICING_STATUS_CODE = :B3 )) AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN
(:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND QP_NUMBER.CANONICAL_TO_NUMBER(DECODE(QPQ.QUALIFIER_DATATYPE, :B16 , QPLATQ.VALUE_FROM, NULL)) BETWEEN QPQ.QUAL_ATTR_VALUE_FROM_NUMBER AND QPQ.QUAL_ATTR_VALUE_TO_NUMBER AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = '
N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(QPQ QP_QUALIFIERS_N13) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST
, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B17 AND QPQ.QUALIFIER_DATATYPE = :B16 AND QPQ.SEARCH_IND = 1 AND QPQ.LIS
T_LINE_ID <> -1 AND QPQ.HEADER_QUALS_EXIST_FLAG = :B9 AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND QP_NUMBER.CANONICAL_TO_NUMBER(DECODE(QPQ.QUALIFIER_DATATYPE, :B16 , QPLATQ.VALUE_FROM, NULL)) BETWEEN QPQ.QUAL_ATTR_VALUE_FROM_NUMBER AND QPQ.QUAL_ATTR_VALUE_TO_NUMBER AND ((QPH.CURRENCY_CODE IS NOT
NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(qpq QP_QUALIFIERS_N7) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE
_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_D
ATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B17 AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND ( QPQ.LIST_HEADER_ID IN (SELECT /*+ no_unnest push_subq index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_PHASE_ID = :B8 AND PRICING_STATUS_CODE = :B3 )) AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES QP_PA WH
ERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND QPQ.QUALIFIER_DATATYPE IN (:B20 , :B19 , :B18 ) AND QPLATQ.VALUE_FROM BETWEEN QPQ.QUALIFIER_ATTR_VALUE AND QPQ.QUALIFIER_ATTR_VALUE_TO AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 )
>= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(QPQ QP_QUALIFIERS_N13) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONT
EXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPRE
Q_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B17 AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND QPQ.HEADER_QUALS_EXIST_FLAG = :B9 AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QP
PROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND QPQ.QUALIFIER_DATATYPE IN (:B20 , :B19 , :B18 ) AND QPLATQ.VALUE_FROM BETWEEN QPQ.QUALIFIER_ATTR_VALUE AND QPQ.QUALIFIER_ATTR_VALUE_TO AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_
CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(qpq QP_QUALIFIERS_N7) index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE
, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBU
TE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =' AND QPQ.QUALIFIER_ATTR_VALUE <> QPLATQ.VALUE_FROM AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND ( QPQ.LIST_HEADER_ID IN (SELECT /*+ no_unnest push_subq index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_PHASE_ID = :B8 AND PRICING_STATUS_CODE = :B3 )) AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND
IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index(QPQ QP_QUALIFIERS_N13)
index(qph qp_list_headers_b_n7) index(qplatq qp_preq_line_attrs_tmp_n2) l_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B2 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B8 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GR
OUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_QUALIFIERS QPQ , QP_LIST_HEADER_PHASES QPLH, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPLH.LIST_HEADER_ID AND QPLH.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLH.PRICING_PHASE_ID = :B8 AND QPLH.PRIC_PROD_ATTR_ONLY_FLAG = 'N' AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =' AND QPQ.QUALIFIER_ATTR_VALUE <> QPLATQ.VALUE_FROM AND QPQ.SEARCH_IND = 1 AND QPQ.LIST_LINE_ID <> -1 AND QPQ.HEADER_QUALS_EXIST_FLAG = :B9 AND (NOT EXISTS (SELECT /*+ INDEX (qp_pa, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PR
ICING_ATTRIBUTES QP_PA WHERE QP_PA.LIST_LINE_ID = QPQ.LIST_LINE_ID AND ROWNUM = 1) OR EXISTS (SELECT /*+ ORDERED USE_NL(qpprod) INDEX (c, QP_PRICING_ATTRIBUTES_N2) */ 'x' FROM QP_PRICING_ATTRIBUTES C, QP_NPREQ_LINE_ATTRS_TMP QPPROD WHERE C.LIST_HEADER_ID = QPQ.LIST_HEADER_ID AND C.LIST_LINE_ID = QPQ.LIST_LINE_ID AND C.PRICING_PHASE_ID = :B8 AND QPPROD.CONTEXT = C.PRODUCT_ATTRIBUTE_CONTEXT AND QPPROD.ATTRIBUTE = C.PRODUCT_ATTRIBUTE AND QPPROD.VALUE_FROM = C.PRODUCT_ATTR_VALUE AND QPPROD.PRICING_STATUS_CODE = :B3 AND C.QUALIFICATION_IND IN (:B15 , :B14 , :B13 , :B12 ) AND QPPROD.ATTRIBUTE_TYPE = :B11 AND C.EXCLUDER_FLAG = :B9 AND ROWNUM = 1) ) AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B7 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPH.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B6 ) >= :B6 AND NVL(QPQ.START_DATE_ACTIVE, :B5 ) <= :B5 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.LIST_
TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B4 AND QPQ.ACTIVE_FLAG = :B4 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B4 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B3 AND QPLATQ.ATTRIBUTE_TYPE = :B2 AND QPRS.REQUEST_TYPE_CODE = :B1 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) |
c8yhu3pmcjddw |
insert into wrh$_tablespace_stat (dbid, con_dbid, snap_id, instance_number, ts#, tsname, contents, status, segment_space_management, extent_management, is_backup) select /*+ opt_param('_optimizer_mjc_enabled', 'false') */ :dbid, aw$sys.con_dbid con_dbid, :snap_id, :instance_number, ts.ts#, ts.name as tsname, decode(ts.contents$, 0, (decode(bitand(ts.flags, 16), 16, 'UNDO', 'PERMANENT')), 1, 'TEMPORARY') as contents, decode(ts.online$, 1, 'ONLINE', 2, 'OFFLINE', 4, 'READ ONLY', 'UNDEFINED') as status, decode(bitand(ts.flags, 32), 32, 'AUTO', 'MANUAL') as segspace_mgmt, decode(ts.bitmapped, 0, 'DICTIONARY', 'LOCAL') as extent_management, (case when b.active_count > 0 then 'TRUE' else 'FALSE' end) as is_backup FROM x$kewpdbinsnap aw$sys, awri$_cdb_ts$ ts, (select aw$awr2.con_id con_id, dfile.ts#, sum( case when bkup.status = '
ACTIVE' then 1 else 0 end ) as active_count FROM x$kewpdbinsnap aw$awr2, v$backup bkup, v$datafile dfile WHERE ((bkup.con_id = dfile.con_id) OR (bkup.con_id = 0 AND dfile.con_id = 1) OR (bkup.con_id = 1 AND dfile.con_id = 0)) AND ((bkup.con_id = aw$awr2.con_id) OR (bkup.con_id = 0 AND aw$awr2.con_id = 1)) AND (aw$awr2.con_id <> 0) and bkup.file# = dfile.file# and dfile.status in ('ONLINE', 'SYSTEM') group by aw$awr2.con_id, dfile.ts#) b WHERE ((ts.con_id = b.con_id) OR (ts.con_id = 0 AND b.con_id = 1) OR (ts.con_id = 1 AND b.con_id = 0)) AND ((ts.con_id = aw$sys.con_id) OR (ts.con_id = 0 AND aw$sys.con_id = 1)) AND (aw$sys.con_id <> 0) and ts.online$ != 3 and b.ts# = ts.ts# and bitand(ts.flags, 2048) != 2048 |
cf030hrp7d40k | SELECT PARTY_ID FROM HZ_CUST_ACCOUNTS WHERE CUST_ACCOUNT_ID = :B1 |
cg4wq7jj6ymkz | UPDATE /*+ dynamic_sampling(1) */ QP_NPREQ_LINE_ATTRS_TMP LATTR SET VALUE_FROM = QP_NUMBER.NUMBER_TO_CANONICAL(QP_NUMBER.CANONICAL_TO_NUMBER(LATTR.VALUE_FROM)), VALUE_TO = QP_NUMBER.NUMBER_TO_CANONICAL(QP_NUMBER.CANONICAL_TO_NUMBER(LATTR.VALUE_TO)) WHERE ATTRIBUTE_TYPE = :B2 AND PRICING_STATUS_CODE = :B1 AND EXISTS ( SELECT FORMAT_TYPE FROM FND_FLEX_VALUE_SETS VSET, QP_SEGMENTS_B SEGMENTS, QP_PRC_CONTEXTS_B PCONTEXTS WHERE VSET.FLEX_VALUE_SET_ID = SEGMENTS.USER_VALUESET_ID AND SEGMENTS.APPLICATION_ID = 661 AND PCONTEXTS.PRC_CONTEXT_TYPE <> 'QUALIFIER' AND PCONTEXTS.PRC_CONTEXT_CODE = LATTR.CONTEXT AND SEGMENTS.SEGMENT_MAPPING_COLUMN = LATTR.ATTRIBUTE AND SEGMENTS.PRC_CONTEXT_ID = PCONTEXTS.PRC_CONTEXT_ID AND VSET.FORMAT_TYPE = 'N') |
cvn54b7yz0s8u | select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#, length, piece from idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece# |
dawf7hvg1ym94 | select V.PROFILE_OPTION_VALUE from FND_PROFILE_OPTIONS O, FND_PROFILE_OPTION_VALUES V where O.PROFILE_OPTION_NAME = :1 and V.LEVEL_ID = :2 and O.START_DATE_ACTIVE <= SYSDATE and nvl(O.END_DATE_ACTIVE, SYSDATE) >= SYSDATE and O.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID and O.APPLICATION_ID = V.APPLICATION_ID and V.LEVEL_VALUE = :3 |
dfffkcnqfystw |
WITH MONITOR_DATA AS (SELECT INST_ID, KEY, NVL2(PX_QCSID, NULL, STATUS) STATUS, FIRST_REFRESH_TIME, LAST_REFRESH_TIME, REFRESH_COUNT, PROCESS_NAME, SID, SQL_ID, SQL_EXEC_START, SQL_EXEC_ID, DBOP_NAME, DBOP_EXEC_ID, SQL_PLAN_HASH_VALUE, SQL_FULL_PLAN_HASH_VALUE, SESSION_SERIAL#, SQL_TEXT, IS_FULL_SQLTEXT, PX_SERVER#, PX_SERVER_GROUP, PX_SERVER_SET, PX_QCINST_ID, PX_QCSID, CASE WHEN ELAPSED_TIME < (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) THEN (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) ELSE ELAPSED_TIME END ELAPSED_TIME, QUEUING_TIME, CPU_TIME, APPLICATION_WAIT_TIME, CONCURRENCY_WAIT_TIME, CLUSTER_WAIT_TIME, USER_IO_WAIT_TIME, CASE WHEN ELAPSED_TIME < (CPU_TIME+ APPLICATION_WAIT_TIME+ CONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) THEN 0 ELSE ELAPSED_TIME - (CPU_TIME+ APPLICATION_WAIT_TIME+ C
ONCURRENCY_WAIT_TIME+ CLUSTER_WAIT_TIME+ USER_IO_WAIT_TIME+ QUEUING_TIME) END OTHER_WAIT_TIME, PLSQL_EXEC_TIME, JAVA_EXEC_TIME, FETCHES, BUFFER_GETS, IO_INTERCONNECT_BYTES IO_INTER_BYTES, PHYSICAL_READ_REQUESTS READ_REQS, PHYSICAL_READ_BYTES READ_BYTES, PHYSICAL_WRITE_REQUESTS WRITE_REQS, PHYSICAL_WRITE_BYTES WRITE_BYTES, NVL(PHYSICAL_READ_BYTES, 0) + NVL(PHYSICAL_WRITE_BYTES, 0) IO_BYTES, NVL(PHYSICAL_READ_REQUESTS, 0) + NVL(PHYSICAL_WRITE_REQUESTS, 0) IO_REQS, USER# USERID, USERNAME, MODULE, ACTION, SERVICE_NAME, CLIENT_IDENTIFIER, CLIENT_INFO, PROGRAM, PLSQL_OBJECT_ID PL_OID, PLSQL_SUBPROGRAM_ID PL_PROGID, PLSQL_ENTRY_OBJECT_ID PL_ENTRY_OID, PLSQL_ENTRY_SUBPROGRAM_ID PL_ENTRY_PROGID, PX_MAXDOP MAX_DOP, PX_IS_CROSS_INSTANCE, PX_MAXDOP_INSTANCES MAX_DOP_INSTANCES, PX_SERVERS_REQUESTED SERVERS_REQUESTED, PX_SERVERS_ALLOCATED SERVERS_ALLOCATED, ERROR_NUMBER, ERROR_FACILITY, ERROR_MESSAGE, NVL2(OTHER_XML, 'Y', NULL) HAS_OTHER_XML, NVL2(BINDS_XML, '
Y', NULL) HAS_BINDS_XML, NVL2(RM_CONSUMER_GROUP, NVL2(RM_LAST_ACTION_TIME, TO_CHAR(RM_LAST_ACTION_TIME, :B12 ), '00/00/0000 00:00:01') || XMLELEMENT( "rminfo", XMLATTRIBUTES( RM_LAST_ACTION AS "rmlastact", RM_LAST_ACTION_REASON AS "rmlastreason", TO_CHAR(RM_LAST_ACTION_TIME, :B12 ) AS "rmlasttime", RM_CONSUMER_GROUP AS "rmcg")).GETSTRINGVAL(), '00/00/0000 00:00:00') RM_INFO, CON_NAME, CON_ID FROM GV$SQL_MONITOR MO1 WHERE MO1.INST_ID BETWEEN :B11 AND :B10 AND MO1.SQL_ID = NVL(:B9 , MO1.SQL_ID) AND MO1.SQL_EXEC_START = NVL(:B8 , MO1.SQL_EXEC_START) AND MO1.SQL_EXEC_ID = NVL(:B7 , MO1.SQL_EXEC_ID) OR (MO1.DBOP_NAME = NVL(:B6 , MO1.DBOP_NAME) AND MO1.DBOP_EXEC_ID = NVL(:B5 , MO1.DBOP_EXEC_ID)) AND ((:B4 = 1 AND MO1.PX_QCSID IS NULL) OR (MO1.PX_SERVER_GROUP = NVL(:B3 , MO1.PX_SERVER_GROUP) AND MO1.PX_SERVER_SET = NVL(:B2 , MO1.PX_SERVER_SET) AND MO1.PX_SERVER# = NVL(:B1 , MO1.PX_SERVER#)))), MONITOR_AGG AS (SELECT MAX_
PX_QCSID, MAX_KEY, MAX_INST_ID, MAX_SESSION_ID, MAX_SESSION_SERIAL, MAX_PX_DOP, MAX_PX_DOP_INSTANCES, MAX_PX_IS_CROSS_INSTANCE, SUM_SERVERS_REQUESTED, SUM_SERVERS_ALLOCATED, DIST_INST_COUNT, DIST_PX_GROUP_COUNT, DIST_PX_SET_COUNT, MAX_PLAN_HASH_VALUE, MAX_FULL_PLAN_HASH_VALUE, MAX_USERID, MAX_PROGRAM, MAX_USERNAME, MAX_MODULE, MAX_ACTION, MAX_SERVICE_NAME, MAX_CLIENT_ID, MAX_CLIENT_INFO, MAX_ERROR_NUMBER, MAX_ERROR_FACILITY, MAX_ERROR_MESSAGE, QC_HAS_OTHER_XML, QC_HAS_BINDS_XML, MAX_PL_OID, MAX_PL_PROGID, MAX_PL_ENTRY_OID, MAX_PL_ENTRY_PROGID, MAX_SQL_ID, MAX_SQL_EXEC_START, MAX_SQL_EXEC_ID, MAX_LAST_REFRESH_TIME, MAX_DBOP_NAME, MAX_DBOP_EXEC_ID, CASE WHEN MAX_PL_OID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = MAX_PL_OID AND P.SUBPROGRAM_ID = MAX_PL_PROGID AND ROWNUM = 1), 'Unavailable') END MAX_PL_NAME, CASE WHEN MAX_PL_EN
TRY_OID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = MAX_PL_ENTRY_OID AND P.SUBPROGRAM_ID = MAX_PL_ENTRY_PROGID AND ROWNUM = 1), 'Unavailable') END MAX_PL_ENTRY_NAME, MAX_STATUS, SUM_REFRESH_COUNT, MIN_FIRST_REFRESH_TIME, IS_FULL_TEXT, SQLMON_TEXT, SUM_ELAPSED_TIME, MAX_ELAPSED_TIME, MAX_QUEUING_TIME, SUM_CPU_TIME, SUM_USER_IO_WAIT_TIME, SUM_APPLICATION_WAIT_TIME, SUM_CONCURRENCY_WAIT_TIME, SUM_CLUSTER_WAIT_TIME, SUM_PLSQL_EXEC_TIME, SUM_JAVA_EXEC_TIME, SUM_OTHER_WAIT_TIME, SUM_FETCHES, SUM_BUFFER_GETS, SUM_READ_REQS, SUM_READ_BYTES, SUM_WRITE_REQS, SUM_WRITE_BYTES, SUM_IO_BYTES, SUM_IO_INTER_BYTES, DECODE(:B14 , 1, 'db_name', DB.DB_UNIQUE_NAME) DB_UNIQUE_NAME, DECODE(:B14 , 1, 'platform_name', DB.PLATFORM_NAME) PLATFORM_NAME, DECODE(:B14 , 1, 'host_name', INST.HOST_NAME) HOST_NAME, AGG_RM_INFO MAX_RM_INFO, MAX_CON_NAME, DEC
ODE(MAX_CON_ID, 0, NULL, MAX_CON_ID) MAX_CON_ID FROM (SELECT MAX(PX_QCSID) MAX_PX_QCSID, MAX(CASE WHEN PX_QCSID IS NULL THEN KEY ELSE NULL END) MAX_KEY, MAX(CASE WHEN PX_QCSID IS NULL THEN INST_ID ELSE NULL END) MAX_INST_ID, MAX(CASE WHEN PX_QCSID IS NULL THEN SID ELSE NULL END) MAX_SESSION_ID, MAX(CASE WHEN PX_QCSID IS NULL THEN SESSION_SERIAL# ELSE NULL END) MAX_SESSION_SERIAL, MAX(MAX_DOP) MAX_PX_DOP, MAX(MAX_DOP_INSTANCES) MAX_PX_DOP_INSTANCES, MAX(PX_IS_CROSS_INSTANCE) MAX_PX_IS_CROSS_INSTANCE, SUM(SERVERS_REQUESTED) SUM_SERVERS_REQUESTED, SUM(SERVERS_ALLOCATED) SUM_SERVERS_ALLOCATED, COUNT(DISTINCT INST_ID) DIST_INST_COUNT, COUNT(DISTINCT PX_SERVER_GROUP) DIST_PX_GROUP_COUNT, COUNT(DISTINCT PX_SERVER_SET) DIST_PX_SET_COUNT, MAX(SQL_PLAN_HASH_VALUE) MAX_PLAN_HASH_VALUE, MAX(SQL_FULL_PLAN_HASH_VALUE) MAX_FULL_PLAN_HASH_VALUE, MAX(USERID) MAX_USERID, MAX(PROGRAM) MAX_PROGRAM, MAX(USERNAME) MAX_USERNAME, MAX(MODULE) MAX_MODULE, MAX(ACTION) MAX_ACTION, MAX(SERVI
CE_NAME) MAX_SERVICE_NAME, MAX(CLIENT_IDENTIFIER) MAX_CLIENT_ID, MAX(CLIENT_INFO) MAX_CLIENT_INFO, MAX(ERROR_NUMBER) MAX_ERROR_NUMBER, MAX(ERROR_FACILITY) MAX_ERROR_FACILITY, MAX(ERROR_MESSAGE) MAX_ERROR_MESSAGE, MAX(NVL2(PX_QCSID, HAS_OTHER_XML, NULL)) QC_HAS_OTHER_XML, MAX(HAS_BINDS_XML) QC_HAS_BINDS_XML, MAX(PL_OID) MAX_PL_OID, MAX(PL_PROGID) MAX_PL_PROGID, MAX(PL_ENTRY_OID) MAX_PL_ENTRY_OID, MAX(PL_ENTRY_PROGID) MAX_PL_ENTRY_PROGID, MAX(SQL_ID) MAX_SQL_ID, MAX(SQL_EXEC_START) MAX_SQL_EXEC_START, MAX(SQL_EXEC_ID) MAX_SQL_EXEC_ID, MAX(LAST_REFRESH_TIME) MAX_LAST_REFRESH_TIME, MAX(STATUS) MAX_STATUS, SUM(REFRESH_COUNT) SUM_REFRESH_COUNT, MIN(FIRST_REFRESH_TIME) MIN_FIRST_REFRESH_TIME, MAX(DBOP_NAME) MAX_DBOP_NAME, MAX(DBOP_EXEC_ID) MAX_DBOP_EXEC_ID, CASE WHEN :B13 = 0 THEN NULL ELSE MAX(SQL_TEXT) END SQLMON_TEXT, MAX(IS_FULL_SQLTEXT) IS_FULL_TEXT, SUM(ELAPSED_TIME) SUM_ELAPSED_TIME, MAX(ELAPSED_TIME) MAX_ELAPSED_TIME, MAX(QUEUING_TIME) MAX_QUEUING_TIME, SUM
(CPU_TIME) SUM_CPU_TIME, SUM(USER_IO_WAIT_TIME) SUM_USER_IO_WAIT_TIME, SUM(APPLICATION_WAIT_TIME) SUM_APPLICATION_WAIT_TIME, SUM(CONCURRENCY_WAIT_TIME) SUM_CONCURRENCY_WAIT_TIME, SUM(CLUSTER_WAIT_TIME) SUM_CLUSTER_WAIT_TIME, SUM(PLSQL_EXEC_TIME) SUM_PLSQL_EXEC_TIME, SUM(JAVA_EXEC_TIME) SUM_JAVA_EXEC_TIME, SUM(OTHER_WAIT_TIME) SUM_OTHER_WAIT_TIME, SUM(FETCHES) SUM_FETCHES, SUM(BUFFER_GETS) SUM_BUFFER_GETS, SUM(READ_REQS) SUM_READ_REQS, SUM(READ_BYTES) SUM_READ_BYTES, SUM(WRITE_REQS) SUM_WRITE_REQS, SUM(WRITE_BYTES) SUM_WRITE_BYTES, NVL(SUM(READ_BYTES), 0) + NVL(SUM(WRITE_BYTES), 0) SUM_IO_BYTES, SUM(IO_INTER_BYTES) SUM_IO_INTER_BYTES, MAX(RM_INFO) AGG_RM_INFO, MAX(CON_NAME) MAX_CON_NAME, MAX(CON_ID) MAX_CON_ID FROM MONITOR_DATA) MD, (SELECT HOST_NAME FROM V$INSTANCE) INST, (SELECT DB_UNIQUE_NAME, PLATFORM_NAME FROM V$DATABASE) DB), ASH_DATA AS (SELECT AD0.INST_ID, AD0.SESSION_ID, AD0.PLAN_LINE_ID, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID, AD0.ACTIVITY_BU
CKET_NUM, AD0.PLAN_ACTIVITY_BUCKET_NUM, AD0.SQL, AD0.TOP_LEVEL_SQL_ID, AD0.DBOP_NAME, AD0.IS_MONITORED_SQL, AD0.IS_PX_SLAVE, AD0.BUCKET_ACTIVITY_START, AD0.ACTIVITY_START, AD0.BUCKET_ACTIVITY_END, AD0.ACTIVITY_END, AD0.ACTIVITY_COUNT, AD0.ACTIVITY_TYPE, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.IMQ_COUNT, AD0.WAIT_COUNT, AD0.CPU_COUNT, AD0.OTHER_SQL_COUNT, AD0.PX_SERVER_SET, AD0.PX_DFO_ACTIVITY_COUNT, AD0.DFO_MOST_ACTIVE_IID, AD0.DFO_MOST_ACTIVE_SID, (CASE WHEN AD0.DFO_MOST_ACTIVE_IID = AD0.INST_ID AND AD0.DFO_MOST_ACTIVE_SID = AD0.SESSION_ID AND (((AD0.PX_DFO_ACTIVITY_COUNT / AD0.DFO_MOST_ACTIVE_COUNT) >= AD0.PX_DOP * 1.05) OR ((AD0.PX_DFO_ACTIVITY_COUNT / AD0.DFO_MOST_ACTIVE_COUNT) <= AD0.PX_DOP *0.95)) AND (AD0.DFO_DURATION * 100) > :B32 THEN AD0.ACTIVITY_COUNT ELSE NULL END) DFO_MOST_ACTIVE_COUNT, AD0.BUCKET_DISTINCT_SAMPLES, AD0.SQL_BUCKET_DISTINCT_SAMPLES, CASE WHEN AD0.PX_SERVER_GROUP IS NULL AND AD0.IS_PX_SLAVE = 1 THEN 1 ELSE AD0.PX_SE
RVER_GROUP END PX_SERVER_GROUP, AD0.PX_STEP_ID, AD0.PX_DFO_PAIR_TYPE, AD0.PX_DFO_PAIR_ID, AD0.PX_STEP_ARG, AD0.PX_DOP, CASE WHEN AD0.PX_DOP IS NOT NULL AND AD0.PX_DOP <> AD0.PX_MIN_DOP AND AD0.PX_MIN_DOP != 0 THEN PX_MIN_DOP ELSE NULL END PX_MIN_DOP FROM (SELECT /*+ use_hash(ash) leading(mo) */ ASH.INST_ID, ASH.IS_PX_SLAVE, ASH.SESSION_ID, ASH.PLAN_LINE_ID, ASH.PLSQL_OBJECT_ID, ASH.PLSQL_SUBPROGRAM_ID, ASH.ACTIVITY_BUCKET_NUM, ASH.PLAN_ACTIVITY_BUCKET_NUM, ASH.SQL, ASH.TOP_LEVEL_SQL_ID, ASH.DBOP_NAME, ASH.IS_MONITORED_SQL, ASH.BUCKET_ACTIVITY_START, ASH.ACTIVITY_START, ASH.BUCKET_ACTIVITY_END, ASH.ACTIVITY_END, ASH.ACTIVITY_COUNT, ASH.ACTIVITY_TYPE, ASH.OTHER_SQL_ACTIVITY_TYPE, ASH.EVENT_NAME, ASH.IMQ_COUNT, ASH.WAIT_COUNT, ASH.CPU_COUNT, ASH.OTHER_SQL_COUNT, MO.PX_SERVER_SET, ASH.PX_DFO_ACTIVITY_COUNT, TRUNC(ASH.MOST_ACTIVE_IN_DFO / 10000000000) DFO_MOST_ACTIVE_COUNT, MOD(TRUNC(ASH.MOST_ACTIVE_IN_DFO / 1000000), 10000) DFO_MOST_ACTIVE_IID, MOD(
ASH.MOST_ACTIVE_IN_DFO, 1000000) DFO_MOST_ACTIVE_SID, ASH.DFO_DURATION, ASH.BUCKET_DISTINCT_SAMPLES, ASH.SQL_BUCKET_DISTINCT_SAMPLES, MO.PX_SERVER_GROUP, ASH.PX_STEP_ID, ASH.PX_DFO_PAIR_TYPE, ASH.PX_DFO_PAIR_ID, ASH.PX_STEP_ARG, ASH.PX_DOP, ASH.PX_MIN_DOP FROM (SELECT /*+ no_merge */ MD.INST_ID, MD.SID, MD.SESSION_SERIAL#, MD.PX_SERVER_SET, MD.PX_SERVER_GROUP FROM MONITOR_DATA MD WHERE MD.SID IS NOT NULL OR :B31 = 1) MO, (SELECT /*+ no_merge */ GVTF.INST_ID, GVTF.GLOBAL_SAMPLE_ID, GVTF.IS_PX_SLAVE, GVTF.SESSION_ID, GVTF.PLAN_LINE_ID, GVTF.PLSQL_OBJECT_ID, GVTF.PLSQL_SUBPROGRAM_ID, GVTF.ACTIVITY_BUCKET_NUM, GVTF.PLAN_ACTIVITY_BUCKET_NUM, GVTF.SQL, GVTF.TOP_LEVEL_SQL_ID, GVTF.DBOP_NAME, GVTF.IS_MONITORED_SQL, GVTF.BUCKET_ACTIVITY_START, GVTF.ACTIVITY_START, GVTF.BUCKET_ACTIVITY_END, GVTF.ACTIVITY_END, GVTF.ACTIVITY_COUNT, GVTF.ACTIVITY_TYPE, GVTF.OTHER_SQL_ACTIVITY_TYPE, GVTF.EVENT_NAME, GVTF.IMQ_COUNT, GVTF.WAIT_COUNT, GVTF.CPU_COUNT, GVTF.OTHER_S
QL_COUNT, MAX(GVTF.PER_SERVER_DFO_COUNT * 10000000000 + GVTF.INST_ID * 1000000 + GVTF.SESSION_ID) OVER(PARTITION BY GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID) MOST_ACTIVE_IN_DFO, SUM(GVTF.ACTIVITY_COUNT) OVER(PARTITION BY GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID) PX_DFO_ACTIVITY_COUNT, GVTF.DFO_DURATION, GVTF.PX_STEP_ID, GVTF.PX_DFO_PAIR_TYPE, GVTF.PX_DFO_PAIR_ID, GVTF.PX_STEP_ARG, GVTF.PX_DOP, GVTF.PX_MIN_DOP, COUNT(DISTINCT GVTF.GLOBAL_SAMPLE_ID) OVER(PARTITION BY GVTF.ACTIVITY_BUCKET_NUM) BUCKET_DISTINCT_SAMPLES, COUNT(DISTINCT GVTF.GLOBAL_SAMPLE_ID) OVER(PARTITION BY GVTF.SQL, GVTF.ACTIVITY_BUCKET_NUM) SQL_BUCKET_DISTINCT_SAMPLES FROM TABLE(GV$(CURSOR( (SELECT USERENV('INSTANCE') INST_ID, ASH2.GLOBAL_SAMPLE_ID, CASE WHEN :B30 = 1 AND :B27 > 1 THEN BUCKET_NUM ELSE NULL END ACTIVITY_BUCKET_NUM, CASE WHEN :B29 = 1 AND :B27 > 1 THEN BUCKET_NUM ELSE NULL END PLAN_ACTIVITY_BUCKET_NUM, ASH2.SQL, ASH2.TOP_LEVEL_SQL_ID, ASH2.DBOP_NAME, ASH2.IS_MONITORED_SQL, A
SH2.PLAN_LINE_ID, ASH2.PLSQL_OBJECT_ID, ASH2.PLSQL_SUBPROGRAM_ID, ASH2.ACTIVITY_TYPE, ASH2.OTHER_SQL_ACTIVITY_TYPE, ASH2.EVENT_NAME, ASH2.IS_PX_SLAVE, ASH2.SESSION_ID, ASH2.PX_STEP_ID, ASH2.PX_DFO_PAIR_TYPE, ASH2.PX_DFO_PAIR_ID, ASH2.PX_STEP_ARG, CASE WHEN ASH2.PX_DFO_PAIR_ID IS NOT NULL THEN DECODE(ASH2.PX_DOP, 0, :B28 , ASH2.PX_DOP) ELSE NULL END PX_DOP, ASH2.PX_MIN_DOP, :B20 + NUMTODSINTERVAL(:B26 * (ASH2.BUCKET_NUM-1), 'SECOND') BUCKET_ACTIVITY_START, :B20 + NUMTODSINTERVAL( :B26 * ASH2.BUCKET_NUM - 1, 'SECOND') BUCKET_ACTIVITY_END, ASH2.ACTIVITY_START, ASH2.ACTIVITY_END, ASH2.ACTIVITY_COUNT, ASH2.IMQ_COUNT, ASH2.WAIT_COUNT, ASH2.CPU_COUNT, ASH2.OTHER_SQL_COUNT, SUM(ASH2.ACTIVITY_COUNT) OVER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE, DECODE(ASH2.PX_DFO_PAIR_ID, NULL, NULL, ASH2.SESSION_ID)) PER_SERVER_DFO_COUNT, CEIL((MAX(ASH2.MAX_SAMPLE_DATE) OVER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE) - MIN(ASH2.MIN_SAMPLE_DATE) O
VER(PARTITION BY ASH2.PX_DFO_PAIR_ID, ASH2.PX_DFO_PAIR_TYPE)) * 3600 * 24) DFO_DURATION FROM (SELECT ASH1.BUCKET_NUM, ASH1.GLOBAL_SAMPLE_ID, ASH1.PLAN_LINE_ID, ASH1.PLSQL_OBJECT_ID, ASH1.PLSQL_SUBPROGRAM_ID, ASH1.ACTIVITY_TYPE, ASH1.OTHER_SQL_ACTIVITY_TYPE, ASH1.EVENT_NAME, ASH1.SESSION_ID, ASH1.PX_STEP_ID, ASH1.PX_STEP_ARG, MAX(ASH1.SQL) SQL, MAX(ASH1.IS_MONITORED_SQL) IS_MONITORED_SQL, MAX(ASH1.PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, MAX(ASH1.PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, MIN(SAMPLE_DATE) MIN_SAMPLE_DATE, MAX(SAMPLE_DATE) MAX_SAMPLE_DATE, MAX(ASH1.IS_PX_SLAVE) IS_PX_SLAVE, MAX(ASH1.PX_DOP) PX_DOP, MIN(ASH1.PX_DOP) PX_MIN_DOP, MIN(ASH1.SAMPLE_DATE) ACTIVITY_START, MAX(ASH1.SAMPLE_DATE) ACTIVITY_END, COUNT(ASH1.SQL) ACTIVITY_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Cpu' AND ASH1.EVENT_NAME = 'in memory' THEN 1 ELSE NULL END) IMQ_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE != 'Other SQL Execution' AND ASH1.ACTIVITY_TYPE != 'Non SQL' AND ASH1.ACTIVITY_TYPE != 'Cp
u' THEN 1 ELSE NULL END) WAIT_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Cpu' AND ASH1.EVENT_NAME IS NULL THEN 1 ELSE NULL END) CPU_COUNT, COUNT(CASE WHEN ASH1.ACTIVITY_TYPE = 'Other SQL Execution' AND ASH1.ACTIVITY_TYPE != 'Non SQL' THEN 1 ELSE NULL END) OTHER_SQL_COUNT, MAX(ASH1.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL_ID, MAX(ASH1.DBOP_NAME) DBOP_NAME FROM ( SELECT (CASE WHEN :B27 > 1 THEN (TRUNC(DELTA_TIME_SECONDS/ :B26 ) + 1) ELSE 1 END) BUCKET_NUM, ASH00.SQL, ASH00.SAMPLE_DATE, NVL2(DUP.C2, TRUNC(DELTA_TIME_SECONDS/ (:B25 )) + 1, NULL) GLOBAL_SAMPLE_ID, NVL2(DUP.C2, NULL, ASH00.IS_MONITORED_SQL) IS_MONITORED_SQL, NVL2(DUP.C2, NULL, ASH00.IN_INMEMORY_QUERY) IN_INMEMORY_QUERY, NVL2(DUP.C2, NULL, ASH00.WAIT_CLASS) WAIT_CLASS, NVL2(DUP.C2, NULL, ASH00.ACTIVITY_TYPE) ACTIVITY_TYPE, NVL2(DUP.C2, NULL, ASH00.OTHER_SQL_ACTIVITY_TYPE) OTHER_SQL_ACTIVITY_TYPE, NVL2(DUP.C2, NULL, ASH00.EVENT_NAME) EVENT_NAME, NVL2(DUP.C2, NULL, ASH00.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL
_ID, NVL2(DUP.C2, NULL, ASH00.DBOP_NAME) DBOP_NAME, NVL2(DUP.C2, NULL, ASH00.IS_PX_SLAVE) IS_PX_SLAVE, NVL2(DUP.C2, NULL, ASH00.SESSION_ID) SESSION_ID, NVL2(DUP.C2, NULL, ASH00.PLSQL_OBJECT_ID) PLSQL_OBJECT_ID, NVL2(DUP.C2, NULL, ASH00.PLSQL_SUBPROGRAM_ID) PLSQL_SUBPROGRAM_ID, NVL2(DUP.C2, NULL, ASH00.PLAN_LINE_ID) PLAN_LINE_ID, NVL2(DUP.C2, NULL, ASH00.PX_STEP_ID) PX_STEP_ID, NVL2(DUP.C2, NULL, ASH00.PX_STEP_ARG) PX_STEP_ARG, NVL2(DUP.C2, NULL, ASH00.PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, NVL2(DUP.C2, NULL, ASH00.PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, NVL2(DUP.C2, NULL, ASH00.PX_DOP) PX_DOP FROM (SELECT 1 C1, NULL C2 FROM V$TIMER UNION ALL SELECT 1 C1, 1 C2 FROM V$TIMER) DUP, (SELECT /*+ no_merge */ 1 C1, ASH000.SAMPLE_DATE, ASH000.IS_MONITORED_SQL, ((EXTRACT(SECOND FROM(DELTA_TIME)) + EXTRACT(MINUTE FROM(DELTA_TIME)) * 60 + EXTRACT(HOUR FROM(DELTA_TIME)) * 3600 + EXTRACT(DAY FROM(DELTA_TIME)) * 86400)) DELTA_TIME_SECONDS, ASH000.IN_INMEMORY_QUERY, ASH00
0.WAIT_CLASS, DECODE(ASH000.IS_MONITORED_SQL, 1, NVL(ASH000.WAIT_CLASS, 'Cpu'), DECODE(SQL_ID, NULL, 'Non SQL', 'Other SQL Execution')) ACTIVITY_TYPE, NVL(ASH000.WAIT_CLASS, 'Cpu') OTHER_SQL_ACTIVITY_TYPE, DECODE(:B24 , 1, CASE WHEN ASH000.IS_MONITORED_SQL = 1 THEN NVL(ASH000.EVENT, DECODE(ASH000.IN_INMEMORY_QUERY, 'Y', 'in memory', ASH000.EVENT)) WHEN ASH000.SQL_ID IS NOT NULL THEN 'sql_id: ' || ASH000.SQL_ID WHEN ASH000.CALL_NAME IS NOT NULL THEN 'call: ' || ASH000.CALL_NAME ELSE 'anonymous: '|| ASH000.EVENT END, NULL) EVENT_NAME, CASE WHEN ASH000.IS_MONITORED_SQL = 1 AND (NVL(ASH000.SQL_ID, :B9 ) = :B9 OR NVL(ASH000.DBOP_NAME, :B6 ) = :B6 ) THEN 'this' WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.SQL_ID IS NOT NULL AND ASH000.TOP_LEVEL_SQL_ID != ASH000.SQL_ID THEN ASH000.TOP_LEVEL_SQL_ID WHEN ASH000.SQL_ID IS NOT NULL THEN ASH000.SQL_ID ELSE NVL(CALL_NAME, 'anonymous') END SQL, CASE WHEN ASH000.IS_PX_SLAVE = 0 AND (ASH000.SQL_ID IS NULL OR ASH000.TOP_LEVEL_SQL_ID !=
ASH000.SQL_ID) THEN ASH000.TOP_LEVEL_SQL_ID END TOP_LEVEL_SQL_ID, ASH000.DBOP_NAME, ASH000.IS_PX_SLAVE, CASE WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.IS_MONITORED_SQL != 1 THEN 65536 ELSE ASH000.SESSION_ID END SESSION_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PLSQL_OBJECT_ID, NULL) PLSQL_OBJECT_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PLSQL_SUBPROGRAM_ID, NULL) PLSQL_SUBPROGRAM_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.SQL_PLAN_LINE_ID, NULL) PLAN_LINE_ID, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PX_STEP_ID, NULL) PX_STEP_ID, CASE WHEN ASH000.IS_PX_SLAVE = 1 AND ASH000.IS_MONITORED_SQL = 1 AND ASH000.PX_STEP_ID IN (1, 2, 3) THEN ASH000.PX_STEP_ARG ELSE NULL END PX_DFO_PAIR_ID, CASE WHEN ASH000.IS_PX_SLAVE = 0 OR ASH000.IS_MONITORED_SQL != 1 THEN NULL WHEN ASH000.PX_STEP_ID = 1 THEN 1 WHEN ASH000.PX_STEP_ID IN (2, 3) THEN 0 ELSE NULL END PX_DFO_PAIR_TYPE, DECODE(ASH000.IS_MONITORED_SQL, 1, ASH000.PX_STEP_ARG, NULL) PX_STEP_ARG, DECODE(ASH000.IS_
MONITORED_SQL, 1, ASH000.PX_DOP, NULL) PX_DOP FROM (SELECT ASH0.*, CASE WHEN ASH0.IS_TARGET_SQL = 1 OR (ASH0.IS_PX_SLAVE = 1 AND ((NVL(ASH0.TOP_LEVEL_SQL_ID, ASH0.SQL_ID) IS NOT NULL AND NVL(ASH0.TOP_LEVEL_SQL_ID, ASH0.SQL_ID) = :B9 ) OR (SQL_ID IS NULL AND :B23 = 'Y'))) THEN 1 ELSE 0 END IS_MONITORED_SQL FROM (SELECT (CASE WHEN (ASH.SQL_ID = :B9 AND ASH.SQL_EXEC_ID = :B7 AND ASH.SQL_EXEC_START = :B8 ) THEN 1 ELSE 0 END) IS_TARGET_SQL, ASH.SQL_ID, ASH.SQL_PLAN_LINE_ID, ASH.PLSQL_OBJECT_ID, ASH.PLSQL_SUBPROGRAM_ID, ASH.TOP_LEVEL_SQL_ID, DECODE(ASH.SQL_ID, NULL, ASH.TOP_LEVEL_CALL_NAME, NULL) CALL_NAME, ASH.EVENT, ASH.IN_INMEMORY_QUERY, ASH.WAIT_CLASS, ASH.SQL_EXEC_ID, ASH.SQL_EXEC_START, ASH.DBOP_NAME, ASH.DBOP_EXEC_ID, ASH.SESSION_ID, ASH.SESSION_SERIAL#, CASE WHEN QC_INSTANCE_ID IS NOT NULL AND (ASH.SESSION_ID != ASH.QC_SESSION_ID OR ASH.SESSION_SERIAL# != ASH.QC_SESSION_SERIAL# OR USERENV('instance') != ASH.QC_INSTANCE_ID) THEN 1 ELSE 0 END IS_PX_SLAVE, SAMP
LE_TIME - CAST(:B20 AS TIMESTAMP) DELTA_TIME, CAST(FROM_TZ(ASH.SAMPLE_TIME, DBTIMEZONE) AS DATE) SAMPLE_DATE, TRUNC(MOD(PX_FLAGS/65536, 32)) PX_STEP_ID, MOD(PX_FLAGS, 65536) PX_STEP_ARG, TRUNC(PX_FLAGS/2097152) PX_DOP FROM V$ACTIVE_SESSION_HISTORY ASH WHERE ((ASH.SESSION_ID = :B19 AND ASH.SESSION_SERIAL# = :B18 AND USERENV('INSTANCE') = :B17 ) OR (ASH.QC_SESSION_ID IS NOT NULL AND ASH.QC_SESSION_ID = :B19 AND ASH.QC_SESSION_SERIAL# = :B18 AND ASH.QC_INSTANCE_ID = :B17 )) AND SAMPLE_TIME BETWEEN :B16 AND :B15 ) ASH0 WHERE (ASH0.SAMPLE_DATE BETWEEN :B20 + 1/24/3600 AND :B22 - 1/24/3600 OR (ASH0.SQL_ID = :B9 AND ASH0.SQL_EXEC_START = :B8 AND ASH0.SQL_EXEC_ID = :B7 ) OR (ASH0.DBOP_NAME = :B6 AND ASH0.DBOP_EXEC_ID = :B5 )) AND (:B21 IS NULL OR ASH0.SQL_PLAN_LINE_ID = :B21 ) AND (ASH0.IS_PX_SLAVE = 0 OR ASH0.SQL_ID IS NOT NULL)) ASH000 ) ASH00 WHERE ASH00.C1 = DUP.C1) ASH1 WHERE ASH1.BUCKET_NUM > 0 AND ASH1.BUCKET_NUM <= :B27 GROUP BY USERENV('INSTANCE'), ASH1.GLOBAL_SAMPLE_ID,
ASH1.BUCKET_NUM, ASH1.SESSION_ID, ASH1.PLAN_LINE_ID, ASH1.PLSQL_OBJECT_ID, ASH1.PLSQL_SUBPROGRAM_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME, ASH1.OTHER_SQL_ACTIVITY_TYPE, ASH1.PX_STEP_ID, ASH1.PX_STEP_ARG) ASH2)))) GVTF WHERE GVTF.INST_ID BETWEEN :B11 AND :B10 ) ASH WHERE ASH.GLOBAL_SAMPLE_ID IS NULL AND ASH.SESSION_ID = MO.SID(+) AND ASH.INST_ID = MO.INST_ID(+)) AD0), RESPONSE_TIME_DATA AS (SELECT ADH.BUCKET_NUM, ADH.SQL_ROWNUM, ADH.SQL, ADH.TOP_LEVEL_SQL_ID, ADH.DBOP_NAME, ADH.PX_ID, DECODE( ADH.PX_STEP_ID, NULL, NULL, 0, NULL, 1, 'PX Server(s) - Executing Parent DFO', 2, 'PX Server(s) - Executing Child DFO', 3, 'PX Server(s) - Sampling Child DFO', 4, 'PX Server(s) - Joining Group', 5, 'QC - Scheduling Child DFO', 6, 'QC - Scheduling Parent DFO', 7, 'QC - Initializing Objects', 8, 'QC - Flushing Objects', 9, 'QC - Allocating Slaves', 10, 'QC - Initializing Granules', 11, 'PX Server(s) - Parsing Cursor', 12, 'PX Server(s) - Executing Cursor',
13, 'PX Server(s) - Preparing Transaction', 14, 'PX Server(s) - Joining Transaction', 15, 'PX Server(s) - Load Commit', 16, 'PX Server(s) - Aborting Transaction', 17, 'QC - Executing Child DFO', 18, 'QC - Executing Parent DFO', 'PX Step - ' || PX_STEP_ID) PX_STEP_ID, ADH.PX_STEP_ARG, ADH.PX_DFO_PAIR_ID, ADH.PX_DOP, ADH.PX_MIN_DOP, ADH.DFO_MOST_ACTIVE_IID, ADH.DFO_MOST_ACTIVE_SID, ADH.DFO_MOST_ACTIVE_COUNT, ADH.ACTIVITY_START, ADH.ACTIVITY_END, ADH.ACTIVITY_TYPE, ADH.OTHER_SQL_ACTIVITY_TYPE, ADH.EVENT_NAME, ADH.PLAN_LINE_ID, ADH.PLSQL_OBJECT_ID, ADH.PLSQL_SUBPROGRAM_ID, CASE WHEN PLSQL_ROWNUM = 1 AND ADH.PLSQL_OBJECT_ID IS NOT NULL THEN NVL((SELECT P.OWNER || '.' || P.OBJECT_NAME || DECODE(P.PROCEDURE_NAME, NULL, '', '.' || P.PROCEDURE_NAME) FROM DBA_PROCEDURES P WHERE P.OBJECT_ID = ADH.PLSQL_OBJECT_ID AND P.SUBPROGRAM_ID = ADH.PLSQL_SUBPROGRAM_ID), 'Unavailable') ELSE NULL END PLSQL_NAME, ADH.ACTIVITY_COUNT, ADH.BUCKET_ACTIVE_SECONDS, ADH.BUCKET_IDL
E_SECONDS, (CASE WHEN ADH.IS_MONITORED_SQL = 0 THEN ADH.ACTIVE_SECONDS WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_CPU_HEIGHT >= :B34 THEN DECODE(ADH.ACTIVITY_TYPE, 'Cpu', (ADH.DFO_PAIR_ACTIVITY_HEIGHT / ADH.DFO_PAIR_CPU_HEIGHT) * ADH.DFO_PAIR_TOTAL_SECONDS, 0) WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.PX_DOP > :B34 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * DECODE(ADH.ACTIVITY_TYPE, 'Cpu', ADH.DFO_PAIR_ACTIVITY_HEIGHT, (ADH.DFO_PAIR_ACTIVITY_HEIGHT * (:B34 - ADH.DFO_PAIR_CPU_HEIGHT)) / (ADH.DFO_PAIR_TOTAL_HEIGHT_ADJ - ADH.DFO_PAIR_CPU_HEIGHT))) / :B34 WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL THEN (ADH.DFO_PAIR_TOTAL_SECONDS * ADH.DFO_PAIR_ACTIVITY_HEIGHT) / ADH.PX_DOP ELSE ADH.ACTIVE_SECONDS END) RESP_TIME, (CASE WHEN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_IDLE_HEIGHT > 0 AND ADH.PX_DOP > :B34 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * (ADH.DFO_PAIR_IDLE_HEIGHT * (:B34 - ADH.DFO_PAIR_CPU_HEIGHT)) / (ADH.DFO_PAIR_TOTAL_HEIGHT_ADJ - ADH.DFO_PAIR_CPU_HEIGHT)) / :B34 WH
EN ADH.PX_DFO_PAIR_ID IS NOT NULL AND ADH.DFO_PAIR_IDLE_HEIGHT > 0 THEN (ADH.DFO_PAIR_TOTAL_SECONDS * ADH.DFO_PAIR_IDLE_HEIGHT) / ADH.PX_DOP ELSE 0 END) DFO_PAIR_IDLE_RESP_TIME, ADH.DFO_PAIR_ACTIVITY_HEIGHT, ADH.DFO_PAIR_CPU_HEIGHT, ADH.DFO_PAIR_IDLE_HEIGHT, ADH.DFO_PAIR_TOTAL_HEIGHT, ADH.DFO_PAIR_CPU_ACTIVITY, ADH.DFO_PAIR_TOTAL_SECONDS FROM (SELECT ADH_1.*, (ROW_NUMBER() OVER(PARTITION BY ADH_1.PLSQL_OBJECT_ID, ADH_1.PLSQL_SUBPROGRAM_ID ORDER BY ADH_1.BUCKET_NUM, ADH_1.ACTIVITY_TYPE, ADH_1.EVENT_NAME)) PLSQL_ROWNUM, (ROW_NUMBER() OVER(PARTITION BY ADH_1.SQL ORDER BY ADH_1.BUCKET_NUM, ADH_1.ACTIVITY_TYPE, ADH_1.EVENT_NAME)) SQL_ROWNUM, (CASE WHEN ADH_1.PX_DFO_PAIR_ID IS NOT NULL AND (ADH_1.DFO_PAIR_TOTAL_HEIGHT < ADH_1.PX_DOP) AND (ADH_1.DFO_PAIR_CPU_HEIGHT < :B34 ) THEN ADH_1.PX_DOP - ADH_1.DFO_PAIR_TOTAL_HEIGHT ELSE 0 END) DFO_PAIR_IDLE_HEIGHT, (CASE WHEN ADH_1.PX_DFO_PAIR_ID IS NOT NULL AND (ADH_1.DFO_PAIR_TOTAL_HEIGHT < ADH_1.PX_DOP) AND (ADH_1.DFO_PAIR_
CPU_HEIGHT < :B34 ) THEN ADH_1.PX_DOP ELSE ADH_1.DFO_PAIR_TOTAL_HEIGHT END) DFO_PAIR_TOTAL_HEIGHT_ADJ FROM (SELECT ADH_0.*, (CASE WHEN ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.DFO_PAIR_TOTAL_ACTIVITY * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_TOTAL_HEIGHT, (CASE WHEN ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.DFO_PAIR_CPU_ACTIVITY * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_CPU_HEIGHT, (CASE WHEN ADH_0.PX_DFO_PAIR_ID IS NOT NULL AND ADH_0.DFO_PAIR_TOTAL_SECONDS > 0 THEN (ADH_0.ACTIVITY_COUNT * :B25 ) / ADH_0.DFO_PAIR_TOTAL_SECONDS ELSE 0 END) DFO_PAIR_ACTIVITY_HEIGHT FROM (SELECT AD3.*, (SUM(DECODE(AD3.PX_DFO_PAIR_ID, NULL, 0, AD3.ACTIVE_SECONDS)) OVER(PARTITION BY DECODE(AD3.PX_DFO_PAIR_ID, NULL, NULL, AD3.BUCKET_NUM), DECODE(AD3.PX_DFO_PAIR_ID, NULL, NULL, AD3.PX_STEP_ARG))) DFO_PAIR_TOTAL_SECONDS FROM (SELECT AD2.*, CASE WHEN AD2.IS_MONITORED_SQL = 0 THEN SQL_BUCKET_DISTINCT_SAMPLES * :B25 WHEN AD2.PX_ID IS NULL THE
N AD2.ACTIVITY_COUNT * :B25 WHEN AD2.BUCKET_PARALLEL_MON_ACTIVITY > 0 THEN (AD2.ACTIVITY_COUNT * AD2.BUCKET_PARALLEL_MON_SECONDS) / AD2.BUCKET_PARALLEL_MON_ACTIVITY ELSE 0 END ACTIVE_SECONDS, CASE WHEN AD2.BUCKET_INTERVAL > BUCKET_ACTIVE_SECONDS THEN AD2.BUCKET_INTERVAL - BUCKET_ACTIVE_SECONDS ELSE 0 END BUCKET_IDLE_SECONDS FROM (SELECT AD1.*, (AD1.BUCKET_SERIAL_MON_ACTIVITY * :B25 ) BUCKET_SERIAL_MON_SECONDS, (AD1.BUCKET_TOTAL_MON_ACTIVITY - AD1.BUCKET_SERIAL_MON_ACTIVITY) BUCKET_PARALLEL_MON_ACTIVITY, (AD1.BUCKET_ACTIVE_SECONDS - (AD1.BUCKET_OTHER_ACTIVITY + AD1.BUCKET_SERIAL_MON_ACTIVITY) * :B25 ) BUCKET_PARALLEL_MON_SECONDS, (AD1.BUCKET_OTHER_ACTIVITY * :B25 ) BUCKET_OTHER_SECONDS, DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, SUM(AD1.ACTIVITY_COUNT) OVER(PARTITION BY DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, AD1.BUCKET_NUM), AD1.PX_DFO_PAIR_ID)) DFO_PAIR_TOTAL_ACTIVITY, DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, SUM(DECODE(AD1.ACTIVITY_TYPE, 'Cpu', AD1.ACTIVITY_COUNT,
0)) OVER(PARTITION BY DECODE(AD1.PX_DFO_PAIR_ID, NULL, NULL, AD1.BUCKET_NUM), AD1.PX_DFO_PAIR_ID)) DFO_PAIR_CPU_ACTIVITY FROM (SELECT AD01.*, NVL((SUM(DECODE(AD01.IS_MONITORED_SQL, 1, AD01.ACTIVITY_COUNT, NULL)) OVER(PARTITION BY AD01.BUCKET_NUM)), 0) BUCKET_TOTAL_MON_ACTIVITY, (NVL(SUM(CASE WHEN AD01.IS_MONITORED_SQL = 1 AND AD01.PX_ID IS NULL THEN AD01.ACTIVITY_COUNT ELSE NULL END) OVER(PARTITION BY AD01.BUCKET_NUM), 0)) BUCKET_SERIAL_MON_ACTIVITY, (NVL((SUM(DECODE(AD01.IS_MONITORED_SQL, 0, AD01.SQL_BUCKET_DISTINCT_SAMPLES, NULL)) OVER(PARTITION BY AD01.BUCKET_NUM)), 0)) BUCKET_OTHER_ACTIVITY, (NVL(AD01.BUCKET_DISTINCT_SAMPLES, 0) * :B25 ) BUCKET_ACTIVE_SECONDS, DECODE(AD01.BUCKET_NUM, :B27 , MOD(:B32 , :B26 ), :B26 ) BUCKET_INTERVAL FROM (SELECT AD0.ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.PX_ID, AD0.ACTIVITY_TYPE, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.PLAN_LINE_ID, AD0.PX_STEP_ID, AD0.PX_STEP_ARG, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID,
SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, MAX(AD0.IS_MONITORED_SQL) IS_MONITORED_SQL, MAX(AD0.SQL) SQL, MAX(AD0.TOP_LEVEL_SQL_ID) TOP_LEVEL_SQL_ID, MAX(AD0.DBOP_NAME) DBOP_NAME, MAX(DECODE(AD0.DFO_MOST_ACTIVE_COUNT, NULL, NULL, AD0.DFO_MOST_ACTIVE_IID)) DFO_MOST_ACTIVE_IID, MAX(DECODE(AD0.DFO_MOST_ACTIVE_COUNT, NULL, NULL, AD0.DFO_MOST_ACTIVE_SID)) DFO_MOST_ACTIVE_SID, SUM(AD0.DFO_MOST_ACTIVE_COUNT) DFO_MOST_ACTIVE_COUNT, MAX(PX_DFO_PAIR_TYPE) PX_DFO_PAIR_TYPE, MAX(PX_DFO_PAIR_ID) PX_DFO_PAIR_ID, MAX(AD0.PX_DOP) PX_DOP, MIN(AD0.PX_MIN_DOP) PX_MIN_DOP, MAX(AD0.BUCKET_DISTINCT_SAMPLES) BUCKET_DISTINCT_SAMPLES, MAX(AD0.SQL_BUCKET_DISTINCT_SAMPLES) SQL_BUCKET_DISTINCT_SAMPLES FROM (SELECT AD00.*, (CASE WHEN AD00.IS_MONITORED_SQL = 1 AND (AD00.SESSION_ID != :B19 OR AD00.INST_ID != :B17 ) THEN AD00.PX_SERVER_GROUP END) PX_ID FROM ASH_DATA AD00 WHERE :B33 = 1 ) AD0 GROUP BY AD0.ACTIVITY_BUCKET_NUM,
AD0.PX_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, AD0.OTHER_SQL_ACTIVITY_TYPE, AD0.PLAN_LINE_ID, AD0.PLSQL_OBJECT_ID, AD0.PLSQL_SUBPROGRAM_ID, AD0.PX_STEP_ID, AD0.PX_STEP_ARG ) AD01) AD1) AD2) AD3) ADH_0) ADH_1) ADH) SELECT /*+ no_monitor no_xml_query_rewrite */ XMLELEMENT( "sql_monitor_report", XMLATTRIBUTES(:B59 AS "version", TO_CHAR(:B58 , :B12 ) AS "sysdate"), XMLELEMENT( "report_parameters", NULL, CASE WHEN :B57 IS NOT NULL THEN XMLFOREST( :B57 AS "dbop_name", :B56 AS "dbop_exec_id") ELSE XMLFOREST( :B55 AS "sql_id", :B54 AS "sql_exec_id") END, XMLFOREST( :B53 AS "session_id", :B52 AS "session_serial", TO_CHAR(:B51 , :B12 ) AS "sql_exec_start", :B27 AS "bucket_count", TO_CHAR(:B50 , :B12 ) AS "interval_start", TO_CHAR(:B22 , :B12 ) AS "interval_end", DECODE(:B49 , 'Y', :B48 , NULL) AS "auto_refresh", :B47
AS "base_path"), CASE WHEN :B23 = 'Y' AND :B46 IS NOT NULL AND NOT (:B4 = 1 AND :B3 IS NULL AND :B2 IS NULL AND :B1 IS NULL) THEN XMLELEMENT( "parallel_filter", NULL, XMLFOREST( DECODE(:B4 , 1, 'yes', 'no') AS "qc", :B3 AS "server_group", :B2 AS "server_set", :B1 AS "server_number")) ELSE NULL END), CASE WHEN :B14 = 1 THEN XMLELEMENT( "derived_parameters_testing", NULL, XMLFOREST(:B11 AS "instance_id_low", :B10 AS "instance_id_high", :B26 AS "bucket_interval_sec", :B32 AS "interval_second", :B27 AS "bucket_calc_count", :B45 AS "bucket_calc_max_count", :B13 AS "sel_sqltext")) ELSE NULL END, (SELECT XMLCONCAT( CASE WHEN :B46 IS NULL AND :B60 IS NULL THEN XMLELEMENT( "target", XMLATTRIBUTES(:B17 AS "instance_id", :B19 AS "session_id", :B18 AS "session_serial", NVL2(:B6 , NULL, :B9 ) AS
"sql_id", NVL2(:B6 , NULL, TO_CHAR(:B8 , :B12 )) AS "sql_exec_start", NVL2(:B6 , NULL, :B7 ) AS "sql_exec_id", NVL2(:B6 , :B6 , NULL) AS "dbop_name", NVL2(:B6 , :B5 , NULL) AS "dbop_exec_id", NVL2(:B6 , TO_CHAR(:B8 , :B12 ), NULL) AS "dbop_exec_start", NVL2(:B6 , NULL, MAX_PLAN_HASH_VALUE) AS "sql_plan_hash", NVL2(:B6 , NULL, MAX_FULL_PLAN_HASH_VALUE) AS "sql_full_plan_hash", MAGG.DB_UNIQUE_NAME AS "db_unique_name", MAGG.PLATFORM_NAME AS "db_platform_name", MAGG.HOST_NAME AS "report_host_name"), NVL2(SUM_SERVERS_REQUESTED, XMLELEMENT( "servers_requested", NULL, SUM_SERVERS_REQUESTED), NULL), NVL2(SUM_SERVERS_ALLOCATED, XMLELEMENT( "servers_allocated", NULL, SUM_SERVERS_ALLOCATED), NULL), NVL2(MAX_USERID, XMLELEMENT( "user_id", NULL, MAX_USERID), NULL), NVL2(MAX_USERNAME, XMLELEMENT( "user", NULL
, MAX_USERNAME), NULL), NVL2(MAX_CON_ID, XMLELEMENT( "con_id", NULL, MAX_CON_ID), NULL), NVL2(MAX_CON_NAME, XMLELEMENT( "con_name", NULL, MAX_CON_NAME), NULL), NVL2(MAX_PROGRAM, XMLELEMENT( "program", NULL, MAX_PROGRAM), NULL), NVL2(MAX_MODULE, XMLELEMENT( "module", NULL, MAX_MODULE), NULL), NVL2(MAX_ACTION, XMLELEMENT( "action", NULL, MAX_ACTION), NULL), NVL2(MAX_SERVICE_NAME, XMLELEMENT( "service", NULL, MAX_SERVICE_NAME), NULL), NVL2(MAX_CLIENT_ID, XMLELEMENT( "client_id", NULL, MAX_CLIENT_ID), NULL), NVL2(MAX_CLIENT_INFO, XMLELEMENT( "client_info", NULL, MAX_CLIENT_INFO), NULL), NVL2(MAX_PL_ENTRY_OID, XMLELEMENT( "plsql_entry_object_id", NULL, MAX_PL_ENTRY_OID), NULL), NVL2(MAX_PL_ENTRY_PROGID, XMLELEMENT( "plsql_entry_subprogram_id", NULL, MAX_PL_ENTRY_PROGID), NULL), NVL2(MAX_PL_ENTRY_NAME, XMLELEMENT( "plsql_entry_name
", NULL, MAX_PL_ENTRY_NAME), NULL), NVL2(MAX_PL_OID, XMLELEMENT( "plsql_object_id", NULL, MAX_PL_OID), NULL), NVL2(MAX_PL_PROGID, XMLELEMENT( "plsql_subprogram_id", NULL, MAX_PL_PROGID), NULL), NVL2(MAX_PL_NAME, XMLELEMENT( "plsql_name", NULL, MAX_PL_NAME), NULL), CASE WHEN (:B13 = 0 OR :B6 IS NOT NULL) THEN NULL ELSE XMLELEMENT( "sql_fulltext", XMLATTRIBUTES(NVL2(SQL_VTEXT, 'Y', IS_FULL_TEXT) AS "is_full"), NVL2(SQL_VTEXT, SQL_VTEXT, SQLMON_TEXT)) END, XMLELEMENT( "status", NULL, MAX_STATUS), XMLELEMENT( "refresh_count", NULL, SUM_REFRESH_COUNT), XMLELEMENT( "first_refresh_time", NULL, TO_CHAR(MIN_FIRST_REFRESH_TIME, :B12 )), XMLELEMENT( "last_refresh_time", NULL, TO_CHAR(:B58 , :B12 )), XMLELEMENT( "duration", NULL, GREATEST(:B65 , LEAST(MAX_ELAPSED_TIME/1000000, 1), CEIL(MAX_QUEUING_TIME/1000000))), DECODE(MAX_RM_INFO, '00/00/0000 00
:00:00', NULL, XMLTYPE(SUBSTR(MAX_RM_INFO, 20))), CASE WHEN (:B63 = 'Y') THEN XMLELEMENT( "adaptive_plan", XMLATTRIBUTES(:B64 AS "is_final"), :B63 ) ELSE NULL END, NVL((SELECT XMLFOREST( XMLAGG( XMLELEMENT( "param", XMLATTRIBUTES(E.NAME AS "name"), DECODE(:B14 , 1, 'XXXX', E.VALUE)) ORDER BY E.NAME) AS "optimizer_env") SQL_ENV FROM GV$SQL_OPTIMIZER_ENV E WHERE E.INST_ID = :B17 AND E.SQL_ID = :B9 AND E.CHILD_ADDRESS = HEXTORAW(:B66 ) AND (DECODE(:B14 , 1, 'YES', E.ISDEFAULT) = 'NO' OR E.ID IN (2, 12, 24, 35, 36, 37, 246, 256, 257, 274, 275, 289, 290))), (SELECT XMLELEMENT( "optimizer_env", XMLATTRIBUTES('sys' AS "type"), XMLAGG( XMLELEMENT( "param", XMLATTRIBUTES(E.NAME AS "name"), DECODE(:B14 , 1, 'XXXX', E.VALUE)) ORDER BY E.NAME)) SYS_ENV FROM V$SYS_OPTIMIZER_ENV E WHERE (DECODE(:B14 , 1, 'YES', E.ISDEFAULT) = 'NO' OR E.ID IN (2, 12, 24, 35, 36, 37, 24
6, 256, 257, 274, 275, 289, 290)))) ) END, XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), DECODE(NVL(SUM_ELAPSED_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), SUM_ELAPSED_TIME)), DECODE(NVL(MAX_QUEUING_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MAX_QUEUING_TIME)), DECODE(NVL(SUM_CPU_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), SUM_CPU_TIME)), DECODE(NVL(SUM_USER_IO_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), SUM_USER_IO_WAIT_TIME)), DECODE(NVL(SUM_APPLICATION_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), SUM_APPLICATION_WAIT_TIME)), DECODE(NVL(SUM_CONCURRENCY_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLAT
TRIBUTES('concurrency_wait_time' AS "name"), SUM_CONCURRENCY_WAIT_TIME)), DECODE(NVL(SUM_CLUSTER_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), SUM_CLUSTER_WAIT_TIME)), DECODE(NVL(SUM_PLSQL_EXEC_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), SUM_PLSQL_EXEC_TIME)), DECODE(NVL(SUM_JAVA_EXEC_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), SUM_JAVA_EXEC_TIME)), DECODE(NVL(SUM_OTHER_WAIT_TIME, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('other_wait_time' AS "name"), SUM_OTHER_WAIT_TIME)), DECODE(NVL(SUM_FETCHES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), SUM_FETCHES)), DECODE(NVL(SUM_BUFFER_GETS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), SUM_
BUFFER_GETS)), DECODE(NVL(SUM_READ_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "name"), SUM_READ_REQS)), DECODE(NVL(SUM_WRITE_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), SUM_WRITE_REQS)), DECODE(NVL(SUM_READ_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), SUM_READ_REQS)), DECODE(NVL(SUM_READ_BYTES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), SUM_READ_BYTES)), DECODE(NVL(SUM_WRITE_REQS, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), SUM_WRITE_REQS)), DECODE(NVL(SUM_WRITE_BYTES, 0), 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), SUM_WRITE_BYTES)), CASE WHEN SUM_IO_INTER_BYTES IS NULL OR SUM_IO_BYTES = 0 OR SUM_IO_INTER_BYTES = SUM_IO_BYTES THEN NULL ELSE XMLELEMENT
( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(SUM_IO_BYTES / DECODE(SUM_IO_INTER_BYTES, 0, 1, SUM_IO_INTER_BYTES), 2)) END), CASE WHEN :B33 = 1 THEN (SELECT CASE WHEN SUM(ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_sampled", XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME)) ELSE NULL END FROM (SELECT AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1) ELSE NULL END, NVL2(MAX_ERROR_NUMBER, XMLELEMENT( "error", XMLATTRIBUTES(MAX_ERROR_NUMBER AS "number", MAX_ERROR_FACILITY AS "facility"), MAX_ERROR_MESSAGE), NULL), CASE WHEN :B62 = 1 AND MAGG.QC_HAS_BINDS_XML = 'Y' THEN (SELECT XMLTYPE(BINDS_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = :B17
AND MON.KEY = MAGG.MAX_KEY AND MON.SID = MAGG.MAX_SESSION_ID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END, CASE WHEN :B61 = 1 AND MAGG.QC_HAS_OTHER_XML = 'Y' THEN (SELECT XMLTYPE(OTHER_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = MAGG.MAX_INST_ID AND MON.KEY = MAGG.MAX_KEY AND MON.SID = MAGG.MAX_SESSION_ID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END) FROM (SELECT V.*, CASE WHEN :B13 = 2 AND IS_FULL_TEXT = 'N' AND :B46 IS NULL AND :B60 IS NULL THEN (SELECT SQL_FULLTEXT FROM GV$SQL SQ WHERE SQ.INST_ID BETWEEN :B11 AND :B10 AND SQ.SQL_ID = :B9 AND ROWNUM = 1) ELSE NULL END SQL_VTEXT FROM MONITOR_AGG V) MAGG), CASE WHEN :B44 = 1 THEN (SELECT CASE WHEN AT.ACTIVITY_COUNT > 0 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( :B41 AS "ash_missing_seconds", TO_CHAR(AT.ACTIVITY_START, :B12 ) AS "first_sample_time", TO_CHAR(AT.ACT
IVITY_END, :B12 ) AS "last_sample_time", ROUND((AT.ACTIVITY_END - AT.ACTIVITY_START) * 3600 * 24) + 1 AS "duration", AT.ACTIVITY_COUNT AS "count", AT.IMQ_COUNT AS "imq_count", AT.WAIT_COUNT AS "wait_count", AT.CPU_COUNT AS "cpu_count", DECODE(AT.OTHER_SQL_COUNT, 0, NULL, AT.OTHER_SQL_COUNT) AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), AT.ACTIVITY_TOTAL, AH.GLOB_ACTIVITY_HISTO) WHEN :B41 IS NOT NULL THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( DECODE( :B41 , -1, 'all', TO_CHAR( :B41 )) AS "ash_missing_seconds")) ELSE NULL END FROM (SELECT MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) IMQ_COUNT, SUM(AD1.WAIT_COUNT) WAIT_COUNT, SUM(AD1.CPU_COUNT) CPU_COUNT, SUM(AD1.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)||
AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_TOTAL FROM (SELECT AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1) AT, (SELECT CASE WHEN :B30 = 1 AND :B27 > 1 THEN XMLELEMENT( "activity_histogram", XMLATTRIBUTES( :B26 AS "bucket_interval", :B27 AS "bucket_count", TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR( :B22 , :B12 ) AS "end_time", ROUND(( :B22 - :B20 ) *3600*24) + 1 AS "duration"), XMLAGG( XMLELEMENT(
"bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), ACTIVITY_BUCKET) ORDER BY AD2.BUCKET_NUM)) ELSE NULL END GLOB_ACTIVITY_HISTO FROM (SELECT AD1.BUCKET_NUM, SUM(ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(IMQ_COUNT) IMQ_COUNT, SUM(WAIT_COUNT) WAIT_COUNT, SUM(CPU_COUNT) CPU_COUNT, SUM(OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, MIN(AD1.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD1.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG( XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_BUCKET FROM (SELECT AD0.ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) ACTIVITY_START, MAX(AD0.ACTIVITY_END) ACTIVITY_END, SUM(AD0.
ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(AD0.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD0.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END FROM ASH_DATA AD0 GROUP BY AD0.ACTIVITY_BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.BUCKET_NUM) AD2) AH) ELSE NULL END, CASE WHEN :B33 = 1 THEN (SELECT CASE WHEN AH.ACTIVITY_COUNT > 0 THEN XMLELEMENT( "activity_detail", XMLATTRIBUTES( TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR( :B22 , :B12 ) AS "end_time", :B41 AS "ash_missing_seconds", TO_CHAR(AH.ACTIVITY_START, :B12 ) AS "first_sample_time", TO_CHAR(AH.ACTIVITY_END, :B12 ) AS "last_sample_time", ROUND((AH.ACTIVITY_END - AH.ACTIVITY_START) * 3600 * 24) + 1 AS "duration", :B25 AS "sample_interval", :B26 AS "bucket_interval", :B27 AS
"bucket_count", ROUND((:B22 - :B20 ) *3600*24) + 1 AS "bucket_duration", :B40 AS "cpu_cores", :B34 AS "total_cpu_cores", :B39 AS "hyperthread"), AH.GLOB_ACTIVITY_HISTO) WHEN :B41 IS NOT NULL THEN XMLELEMENT( "activity_detail", XMLATTRIBUTES( DECODE( :B41 , -1, 'all', TO_CHAR( :B41 )) AS "ash_missing_seconds")) ELSE NULL END FROM (SELECT MIN(AD2.ACTIVITY_START) ACTIVITY_START, MAX(AD2.ACTIVITY_END) ACTIVITY_END, SUM(AD2.ACTIVITY_COUNT) ACTIVITY_COUNT, XMLAGG( XMLELEMENT( "bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), ACTIVITY_BUCKET_XML) ORDER BY AD2.BUCKET_NUM) GLOB_ACTIVITY_HISTO FROM (SELECT AD1.BUCKET_NUM, MIN(AD1.ACTIVITY_START) ACTIVITY_START, MAX(AD1.ACTIVITY_END) ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, MAX(AD1.BUCKET_IDLE_SECONDS) BUCKET_IDLE_SECONDS, XMLAGG( XMLCONCAT( CASE WHEN AD1.DFO_PAIR_IDLE_RESP_TIME != 0 AND DFO_PAIR_ROWNUM = 1 THEN XMLELEMENT
( "activity", XMLATTRIBUTES( 'Parallel Skew' AS "class", AD1.PX_STEP_ARG AS "line", AD1.PX_ID AS "px", ROUND(AD1.DFO_PAIR_IDLE_RESP_TIME, 2) AS "rt"), 0) ELSE NULL END, XMLELEMENT( "activity", XMLATTRIBUTES( NVL(AD1.OTHER_SQL, AD1.RPI) AS "sql", AD1.NON_SQL AS "non_sql", AD1.CLASS AS "class", AD1.OTHER_SQL_CLASS AS "other_sql_class", AD1.EVENT AS "event", AD1.PLAN_LINE_ID AS "line", NVL2(AD1.PLSQL_OBJECT_ID, AD1.PLSQL_OBJECT_ID||'.'|| AD1.PLSQL_SUBPROGRAM_ID, NULL) AS "plsql_id", AD1.PLSQL_NAME AS "plsql_name", CASE WHEN AD1.SQL_ROWNUM = 1 THEN AD1.TOP_LEVEL_SQL_ID END AS "top_sql_id", CASE WHEN AD1.DBOP_NAME IS NOT NULL THEN AD1.DBOP_NAME END AS "dbop_name", CASE WHEN AD1.DFO_MOST_ACTIVE_IID IS NOT NULL AND :B67 = 'Y' THEN AD1.DFO_MOST_ACTIVE_IID END AS "skew_iid", DECODE(AD1.DFO_MOST_ACTIVE_COUN
T, NULL, NULL, AD1.DFO_MOST_ACTIVE_SID) AS "skew_sid", AD1.DFO_MOST_ACTIVE_COUNT AS "skew_count", DECODE(AD1.PX_DOP, :B28 , NULL, AD1.PX_DOP) AS "dop", DECODE(AD1.PX_DOP, AD1.PX_MIN_DOP, NULL, AD1.PX_MIN_DOP) AS "min_dop", AD1.PX_ID AS "px", AD1.PX_STEP_ID AS "step", AD1.PX_STEP_ARG AS "arg", DECODE(AD1.ACTIVITY_COUNT, AD1.RESP_TIME, NULL, ROUND(AD1.RESP_TIME, 2)) AS "rt"), AD1.ACTIVITY_COUNT)) ORDER BY AD1.PX_STEP_ID, AD1.PX_STEP_ARG, AD1.DFO_PAIR_ROWNUM) ACTIVITY_BUCKET_XML FROM (SELECT AD01.*, CASE WHEN AD01.ACTIVITY_TYPE != 'Other SQL Execution' AND AD01.ACTIVITY_TYPE != 'Non SQL' THEN AD01.ACTIVITY_TYPE END CLASS, CASE WHEN (AD01.ACTIVITY_TYPE = 'Other SQL Execution' OR AD01.ACTIVITY_TYPE = 'Non SQL') THEN AD01.OTHER_SQL_ACTIVITY_TYPE END OTHER_SQL_CLASS, CASE WHEN AD01.ACTIVITY_TYPE != 'Other SQL Execution' AND AD01.ACTIVITY_TYPE != 'Non SQL' THEN AD01.EVENT_NAME END EVENT, C
ASE WHEN AD01.SQL IN ('this', 'anonymous') THEN NULL ELSE AD01.SQL END RPI, DECODE(AD01.ACTIVITY_TYPE, 'Other SQL Execution', SUBSTR(AD01.EVENT_NAME, 9), NULL) OTHER_SQL, DECODE(AD01.ACTIVITY_TYPE, 'Non SQL', AD01.EVENT_NAME, NULL) NON_SQL, ROW_NUMBER() OVER(PARTITION BY AD01.BUCKET_NUM, AD01.PX_DFO_PAIR_ID ORDER BY AD01.ACTIVITY_TYPE, AD01.EVENT_NAME, AD01.PLAN_LINE_ID) DFO_PAIR_ROWNUM FROM RESPONSE_TIME_DATA AD01) AD1 GROUP BY AD1.BUCKET_NUM) AD2) AH) ELSE NULL END, CASE WHEN :B23 = 'Y' THEN (SELECT XMLELEMENT( "parallel_info", XMLATTRIBUTES( :B17 AS "qc_instance_id", MAX_PX_QCSID AS "qc_session_id", MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MAX_PX_DOP AS "dop", MAX_PX_DOP_INSTANCES AS "max_dop_instances", DIST_INST_COUNT AS "inst_count", DIST_PX_GROUP_COUNT AS "server_group_count", DIST_PX_SET_COUNT AS "server_set_count"), CASE WHEN :B69 = 1 THEN PX_SESSIONS ELSE
NULL END, CASE WHEN :B67 = 'Y' THEN DECODE(:B68 , 1, PX_INSTANCES, NULL) ELSE NULL END) FROM (SELECT MAX_PX_QCSID, MAX_PX_DOP, MAX_PX_DOP_INSTANCES, MAX_PX_IS_CROSS_INSTANCE, SUM_SERVERS_REQUESTED, SUM_SERVERS_ALLOCATED, DIST_INST_COUNT, DIST_PX_GROUP_COUNT, DIST_PX_SET_COUNT, (SELECT XMLELEMENT( "sessions", XMLATTRIBUTES(MAX(PX_SESSION.ACTIVITY_COUNT) AS "max_activity_count", MAX(PX_SESSION.IMQ_COUNT) AS "max_imq_count", MAX(PX_SESSION.CPU_COUNT) AS "max_cpu_count", MAX(PX_SESSION.WAIT_COUNT) AS "max_wait_count", MAX(PX_SESSION.OTHER_SQL_COUNT) AS "max_other_sql_count", MAX(PX_SESSION.MAX_IO_REQS) AS "max_io_reqs", MAX(PX_SESSION.MAX_IO_BYTES) AS "max_io_bytes", MAX(PX_SESSION.MAX_BUFFER_GETS) AS "max_buffer_gets", MAX(PX_SESSION.MAX_ELAPSED_TIME) AS "max_elapsed_time"), XMLAGG(PX_SESSION.PX_SESSION_XML ORDER BY PX_SERVER_GROUP NULLS FIRST, PX_SERVER_SET, PX_SER
VER#)) FROM (SELECT PX_SERVER_GROUP, PX_SERVER_SET, PX_SERVER#, MAX(PI.MAX_ELAPSED_TIME) MAX_ELAPSED_TIME, MAX(PI.MAX_IO_REQS) MAX_IO_REQS, MAX(PI.MAX_IO_BYTES) MAX_IO_BYTES, MAX(PI.MAX_BUFFER_GETS) MAX_BUFFER_GETS, SUM(PI.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(PI.IMQ_COUNT) IMQ_COUNT, SUM(PI.WAIT_COUNT) WAIT_COUNT, SUM(PI.CPU_COUNT) CPU_COUNT, SUM(PI.OTHER_SQL_COUNT) OTHER_SQL_COUNT, XMLELEMENT( "session", XMLATTRIBUTES( INST_ID AS "inst_id", PROCESS_NAME AS "process_name", SID AS "session_id", SESSION_SERIAL# AS "session_serial", PX_SERVER_GROUP AS "server_group", PX_SERVER_SET AS "server_set", PX_SERVER# AS "server_num"), XMLELEMENT( "stats", XMLATTRIBUTES( 'monitor' AS "type"), NVL2(MAX(ELAPSED_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MAX(ELAPSED_TIME)), NULL), NVL2(MAX(QUEUING_TIME), XMLELEMENT( "stat"
, XMLATTRIBUTES('queuing_time' AS "name"), MAX(QUEUING_TIME)), NULL), NVL2(MAX(CPU_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MAX(CPU_TIME)), NULL), NVL2(MAX(USER_IO_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MAX(USER_IO_WAIT_TIME)), NULL), NVL2(MAX(APPLICATION_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MAX(APPLICATION_WAIT_TIME)), NULL), NVL2(MAX(CONCURRENCY_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MAX(CONCURRENCY_WAIT_TIME)), NULL), NVL2(MAX(CLUSTER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MAX(CLUSTER_WAIT_TIME)), NULL), NVL2(MAX(PLSQL_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MAX(PLSQL_EXEC_TIME)), NULL), NVL2(MAX(JAVA
_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MAX(JAVA_EXEC_TIME)), NULL), NVL2(MAX(OTHER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES( 'other_wait_time' AS "name"), MAX(OTHER_WAIT_TIME)), NULL), NVL2(MAX(FETCHES), XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MAX(FETCHES)), NULL), NVL2(MAX(BUFFER_GETS), XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MAX(BUFFER_GETS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(READ_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES
('read_bytes' AS "name"), MAX(READ_BYTES)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(WRITE_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MAX(WRITE_BYTES)), NULL), CASE WHEN MAX(IO_INTER_BYTES) IS NULL OR NVL(MAX(IO_BYTES), 0) = 0 OR MAX(IO_INTER_BYTES) = MAX(IO_BYTES) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MAX(IO_BYTES) / DECODE(MAX(IO_INTER_BYTES), 0, 1, MAX(IO_INTER_BYTES)), 2)) END), CASE WHEN SUM(PI.ACTIVITY_COUNT) > 0 AND :B33 = 1 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(MIN(PI.ACTIVITY_START), :B12 ) AS "first_sample_time", TO_CHAR(MAX(PI.ACTIVITY_END), :B12 ) AS "last_sample_time", ROUND((MAX(PI.ACTIVITY_END) - MIN(PI.ACTIVITY_START)) * 3600 * 24) + 1 AS "duration", SU
M(PI.ACTIVITY_COUNT) AS "count", SUM(PI.IMQ_COUNT) AS "imq_count", SUM(PI.CPU_COUNT) AS "cpu_count", SUM(PI.WAIT_COUNT) AS "wait_count", SUM(PI.OTHER_SQL_COUNT)AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), XMLAGG( NVL2(ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( PI.ACTIVITY_TYPE AS "class", PI.EVENT_NAME AS "event"), ACTIVITY_COUNT), NULL) ORDER BY PI.ACTIVITY_TYPE, PI.EVENT_NAME)) ELSE NULL END, CASE WHEN :B61 = 1 AND PI.HAS_OTHER_XML = 'Y' THEN (SELECT XMLTYPE(OTHER_XML) FROM GV$SQL_MONITOR MON WHERE MON.INST_ID = PI.INST_ID AND MON.KEY = PI.KEY AND MON.SID = PI.SID AND MON.SQL_ID = :B9 AND MON.SQL_EXEC_START = :B8 AND MON.SQL_EXEC_ID = :B7 AND ROWNUM = 1) ELSE NULL END) PX_SESSION_XML FROM (SELECT MO.HAS_OTHER_XML, MO.KEY, MO.INST_ID, DECODE(MO.PROCESS_NAME, 'ora', 'PX Coordinator', MO.PROCESS_NAME) PROCESS_NAME, MO.SID, MO.SESSION_
SERIAL#, MO.PX_SERVER_GROUP, MO.PX_SERVER_SET, MO.PX_SERVER#, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME, MAX(MO.IO_REQS) MAX_IO_REQS, MAX(MO.IO_BYTES) MAX_IO_BYTES, MAX(MO.BUFFER_GETS) MAX_BUFFER_GETS, MAX(MO.ELAPSED_TIME) MAX_ELAPSED_TIME, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.ACTIVITY_COUNT)) ACTIVITY_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.IMQ_COUNT)) IMQ_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.WAIT_COUNT)) WAIT_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.CPU_COUNT)) CPU_COUNT, SUM(DECODE(ASH0.ACTIVITY_TYPE, NULL, NULL, ASH0.OTHER_SQL_COUNT)) OTHER_SQL_COUNT, MIN(ASH0.ACTIVITY_START) ACTIVITY_START, MAX(ASH0.ACTIVITY_END) ACTIVITY_END, MAX(DECODE(MO.ELAPSED_TIME, 0, NULL, MO.ELAPSED_TIME)) ELAPSED_TIME, MAX(DECODE(MO.QUEUING_TIME, 0, NULL, MO.QUEUING_TIME)) QUEUING_TIME, MAX(DECODE(MO.CPU_TIME, 0, NULL, CPU_TIME)) CPU_TIME, MAX(DECODE(MO.FETCHES, 0, NULL, FETCHES)) FETCHES, MAX(DECODE(MO.BUF
FER_GETS, 0, NULL, MO.BUFFER_GETS)) BUFFER_GETS, MAX(DECODE(MO.IO_INTER_BYTES, 0, NULL, MO.IO_INTER_BYTES)) IO_INTER_BYTES, MAX(DECODE(MO.READ_REQS, 0, NULL, MO.READ_REQS)) READ_REQS, MAX(DECODE(MO.READ_BYTES, 0, NULL, MO.READ_BYTES)) READ_BYTES, MAX(DECODE(MO.WRITE_REQS, 0, NULL, MO.WRITE_REQS)) WRITE_REQS, MAX(DECODE(MO.WRITE_BYTES, 0, NULL, MO.WRITE_BYTES)) WRITE_BYTES, MAX(DECODE(MO.IO_BYTES, 0, NULL, MO.IO_BYTES)) IO_BYTES, MAX(DECODE(MO.APPLICATION_WAIT_TIME, 0, NULL, MO.APPLICATION_WAIT_TIME)) APPLICATION_WAIT_TIME, MAX(DECODE(MO.CONCURRENCY_WAIT_TIME, 0, NULL, MO.CONCURRENCY_WAIT_TIME)) CONCURRENCY_WAIT_TIME, MAX(DECODE(MO.CLUSTER_WAIT_TIME, 0, NULL, MO.CLUSTER_WAIT_TIME)) CLUSTER_WAIT_TIME, MAX(DECODE(MO.USER_IO_WAIT_TIME, 0, NULL, MO.USER_IO_WAIT_TIME)) USER_IO_WAIT_TIME, MAX(DECODE(PLSQL_EXEC_TIME, 0, NULL, PLSQL_EXEC_TIME)) PLSQL_EXEC_TIME, MAX(DECODE(MO.JAVA_EXEC_TIME, 0, NULL, MO.JAVA_EXEC_TIME)) JAVA_EXEC_TIME, MAX(DECO
DE(MO.OTHER_WAIT_TIME, 0, NULL, MO.OTHER_WAIT_TIME)) OTHER_WAIT_TIME FROM MONITOR_DATA MO, (SELECT ASH1.INST_ID, ASH1.SESSION_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME, SUM(ASH1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(ASH1.IMQ_COUNT) IMQ_COUNT, SUM(ASH1.WAIT_COUNT) WAIT_COUNT, SUM(ASH1.CPU_COUNT) CPU_COUNT, SUM(ASH1.OTHER_SQL_COUNT)OTHER_SQL_COUNT, MIN(ASH1.ACTIVITY_START) ACTIVITY_START, MAX(ASH1.ACTIVITY_END) ACTIVITY_END FROM ASH_DATA ASH1 GROUP BY ASH1.INST_ID, ASH1.SESSION_ID, ASH1.ACTIVITY_TYPE, ASH1.EVENT_NAME) ASH0 WHERE MO.INST_ID = ASH0.INST_ID(+) AND MO.SID = ASH0.SESSION_ID(+) AND (:B69 = 1 OR :B68 = 1) GROUP BY MO.INST_ID, MO.KEY, MO.HAS_OTHER_XML, MO.PROCESS_NAME, MO.SID, MO.SESSION_SERIAL#, MO.PX_SERVER_GROUP, MO.PX_SERVER_SET, MO.PX_SERVER#, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME) PI WHERE (:B69 = 1) GROUP BY PI.INST_ID, PI.KEY, PI.HAS_OTHER_XML, PI.SID, PI.PROCESS_NAME, PI.SESSION_SERIAL#, PI.PX_SERVER_GROUP, PI.PX_SERVER_SET, PI.PX_SERVER#) P
X_SESSION) PX_SESSIONS, (SELECT XMLELEMENT( "instances", XMLATTRIBUTES( MAX(PX_INSTANCE.ACTIVITY_COUNT) AS "max_activity_count", MAX(PX_INSTANCE.IMQ_COUNT) AS "max_imq_count", MAX(PX_INSTANCE.CPU_COUNT) AS "max_cpu_count", MAX(PX_INSTANCE.WAIT_COUNT) AS "max_wait_count", MAX(PX_INSTANCE.OTHER_SQL_COUNT) AS "max_other_sql_count", MAX(PX_INSTANCE.ELAPSED_TIME) AS "max_elapsed_time", MAX(PX_INSTANCE.BUFFER_GETS) AS "max_buffer_gets", MAX(PX_INSTANCE.IO_REQS) AS "max_io_reqs", MAX(PX_INSTANCE.IO_BYTES) AS "max_io_bytes"), XMLAGG(PX_INSTANCE.PX_INSTANCES_XML ORDER BY INST_ID)) FROM (SELECT PI.INST_ID, MAX(PI.ELAPSED_TIME) ELAPSED_TIME, MAX(PI.IO_REQS) IO_REQS, MAX(PI.IO_BYTES) IO_BYTES, MAX(PI.BUFFER_GETS) BUFFER_GETS, SUM(PI.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(PI.IMQ_COUNT) IMQ_COUNT, SUM(PI.WAIT_COUNT) WAIT_COUNT, SUM(PI.CPU_COUNT) CPU_COUNT, SUM(PI.OTHER_SQL_COUNT) OTHE
R_SQL_COUNT, XMLELEMENT( "instance", XMLATTRIBUTES( INST_ID AS "inst_id"), XMLELEMENT( "stats", XMLATTRIBUTES( 'monitor' AS "type"), NVL2(MAX(ELAPSED_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MAX(ELAPSED_TIME)), NULL), NVL2(MAX(QUEUING_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MAX(QUEUING_TIME)), NULL), NVL2(MAX(CPU_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MAX(CPU_TIME)), NULL), NVL2(MAX(USER_IO_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MAX(USER_IO_WAIT_TIME)), NULL), NVL2(MAX(APPLICATION_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MAX(APPLICATION_WAIT_TIME)), NULL), NVL2(MAX(CONCURRENCY_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS
"name"), MAX(CONCURRENCY_WAIT_TIME)), NULL), NVL2(MAX(CLUSTER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MAX(CLUSTER_WAIT_TIME)), NULL), NVL2(MAX(PLSQL_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MAX(PLSQL_EXEC_TIME)), NULL), NVL2(MAX(JAVA_EXEC_TIME), XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MAX(JAVA_EXEC_TIME)), NULL), NVL2(MAX(OTHER_WAIT_TIME), XMLELEMENT( "stat", XMLATTRIBUTES( 'other_wait_time' AS "name"), MAX(OTHER_WAIT_TIME)), NULL), NVL2(MAX(FETCHES), XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MAX(FETCHES)), NULL), NVL2(MAX(BUFFER_GETS), XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MAX(BUFFER_GETS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('disk_reads' AS "
name"), MAX(READ_REQS)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('direct_writes' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(READ_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MAX(READ_REQS)), NULL), NVL2(MAX(READ_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MAX(READ_BYTES)), NULL), NVL2(MAX(WRITE_REQS), XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MAX(WRITE_REQS)), NULL), NVL2(MAX(WRITE_BYTES), XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MAX(WRITE_BYTES)), NULL), CASE WHEN MAX(IO_INTER_BYTES) IS NULL OR NVL(MAX(IO_BYTES), 0) = 0 OR MAX(IO_INTER_BYTES) = MAX(IO_BYTES) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MAX(IO_BYTES)/ DECODE(MAX(IO_INTER_BYTES), 0, 1, MAX(IO_INTER_BYTES)), 2)) E
ND), CASE WHEN :B33 = 1 AND SUM(PI.ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(MIN(PI.ACTIVITY_START), :B12 ) AS "start_time", TO_CHAR(MAX(PI.ACTIVITY_END), :B12 ) AS "end_time", ROUND((MAX(PI.ACTIVITY_END) - MIN(PI.ACTIVITY_START)) * 3600 * 24) + 1 AS "duration", SUM(PI.ACTIVITY_COUNT) AS "count", SUM(PI.IMQ_COUNT) AS "imq_count", SUM(PI.WAIT_COUNT) AS "wait_count", SUM(PI.CPU_COUNT) AS "cpu_count", SUM(PI.OTHER_SQL_COUNT) AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), XMLAGG( NVL2(ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( PI.ACTIVITY_TYPE AS "class", PI.EVENT_NAME AS "event"), ACTIVITY_COUNT), NULL) ORDER BY PI.ACTIVITY_TYPE, PI.EVENT_NAME)) ELSE NULL END) PX_INSTANCES_XML FROM (SELECT MO.INST_ID, ASH.ACTIVITY_TYPE, ASH.EVENT_NAME, ASH.ACTIVITY_COUNT, A
SH.IMQ_COUNT, ASH.WAIT_COUNT, ASH.CPU_COUNT, ASH.OTHER_SQL_COUNT, ASH.ACTIVITY_START, ASH.ACTIVITY_END, MO.ELAPSED_TIME, MO.QUEUING_TIME, MO.CPU_TIME, MO.APPLICATION_WAIT_TIME, MO.CONCURRENCY_WAIT_TIME, MO.CLUSTER_WAIT_TIME, MO.USER_IO_WAIT_TIME, MO.PLSQL_EXEC_TIME, MO.JAVA_EXEC_TIME, MO.OTHER_WAIT_TIME, MO.FETCHES, MO.BUFFER_GETS, MO.IO_INTER_BYTES, MO.IO_BYTES, MO.READ_REQS, MO.READ_BYTES, MO.WRITE_REQS, MO.WRITE_BYTES, MO.IO_REQS FROM (SELECT MO0.INST_ID, SUM(MO0.ELAPSED_TIME) ELAPSED_TIME, SUM(MO0.QUEUING_TIME) QUEUING_TIME, SUM(MO0.CPU_TIME) CPU_TIME, SUM(MO0.FETCHES) FETCHES, SUM(MO0.BUFFER_GETS) BUFFER_GETS, SUM(MO0.IO_INTER_BYTES) IO_INTER_BYTES, SUM(MO0.IO_BYTES) IO_BYTES, SUM(MO0.READ_REQS) READ_REQS, SUM(MO0.READ_BYTES) READ_BYTES, SUM(MO0.WRITE_REQS) WRITE_REQS, SUM(MO0.WRITE_BYTES) WRITE_BYTES, SUM(MO0.IO_REQS) IO_REQS, SUM(MO0.APPLICATION_WAIT_TIME) APPLICATION_WAIT_TIME, SUM(MO0.CONCURRENCY_WAIT_TIME) CONCURRENCY_WAIT_TIME, SUM(MO0.
CLUSTER_WAIT_TIME) CLUSTER_WAIT_TIME, SUM(MO0.USER_IO_WAIT_TIME) USER_IO_WAIT_TIME, SUM(MO0.PLSQL_EXEC_TIME) PLSQL_EXEC_TIME, SUM(MO0.JAVA_EXEC_TIME) JAVA_EXEC_TIME, SUM(MO0.OTHER_WAIT_TIME) OTHER_WAIT_TIME FROM MONITOR_DATA MO0 GROUP BY MO0.INST_ID) MO, (SELECT ASH0.INST_ID, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME, SUM(ASH0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(ASH0.IMQ_COUNT) IMQ_COUNT, SUM(ASH0.WAIT_COUNT) WAIT_COUNT, SUM(ASH0.CPU_COUNT) CPU_COUNT, SUM(ASH0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, MIN(ASH0.ACTIVITY_START) ACTIVITY_START, MAX(ASH0.ACTIVITY_END) ACTIVITY_END FROM ASH_DATA ASH0 GROUP BY ASH0.INST_ID, ASH0.ACTIVITY_TYPE, ASH0.EVENT_NAME) ASH, MONITOR_AGG WHERE MO.INST_ID = ASH.INST_ID(+) AND MONITOR_AGG.DIST_INST_COUNT > 0 ) PI GROUP BY PI.INST_ID)PX_INSTANCE) PX_INSTANCES FROM MONITOR_AGG)) ELSE NULL END, XPLAN_XML, CASE WHEN :B43 = 1 THEN (SELECT XMLELEMENT( "plan_monitor", XMLATTRIBUTES(MAX(PLI.MAX_LINE_ACTIVITY_COUNT) AS "max_activity_count
", MAX(PLI.OVERALL_MAX_IO_REQS) AS "max_io_reqs", MAX(PLI.OVERALL_MAX_IO_BYTES) AS "max_io_bytes", MAX(PLI.MAX_LINE_IMQ_COUNT) AS "max_imq_count", MAX(PLI.MAX_LINE_CPU_COUNT) AS "max_cpu_count", MAX(PLI.MAX_LINE_WAIT_COUNT) AS "max_wait_count", MAX(PLI.MAX_LINE_OTHER_SQL_COUNT) AS "max_other_sql_count"), XMLAGG( XMLELEMENT( "operation", XMLATTRIBUTES( PLI.PLAN_LINE_ID AS "id", PLI.PARENT_ID AS "parent_id", PLI.OPERATION AS "name", PLI.OPTIONS AS "options", PLI.DEPTH AS "depth", PLI.POSITION AS "position", PLI.INACTIVE AS "skp", PLI.PX_TYPE AS "px_type"), NVL2(PLI.OBJECT_NAME, XMLELEMENT( "object", XMLATTRIBUTES(PLI.OBJECT_TYPE AS "type"), XMLFOREST(PLI.OBJECT_OWNER AS "owner"), XMLFOREST(PLI.OBJECT_NAME AS "name")), NULL), XMLFOREST(PLI.PARTITION_START AS "partition_s
tart", PLI.PARTITION_STOP AS "partition_stop"), CASE WHEN PLI.CARDINALITY IS NULL AND PLI.BYTES IS NULL AND PLI.COST IS NULL AND PLI.TEMP_SPACE IS NULL AND PLI.TIME IS NULL THEN NULL ELSE XMLELEMENT( "optimizer", NULL, NVL2(PLI.CARDINALITY, XMLFOREST(PLI.CARDINALITY AS "cardinality"), NULL), NVL2(PLI.BYTES, XMLFOREST(PLI.BYTES AS "bytes"), NULL), NVL2(PLI.COST, XMLFOREST(PLI.COST AS "cost"), NULL), NVL2(PLI.CPU_COST, XMLFOREST(PLI.CPU_COST AS "cpu_cost"), NULL), NVL2(PLI.IO_COST, XMLFOREST(PLI.IO_COST AS "io_cost"), NULL), NVL2(PLI.TEMP_SPACE, XMLFOREST(PLI.TEMP_SPACE AS "temp"), NULL), NVL2(PLI.TIME, XMLFOREST(PLI.TIME AS "time"), NULL)) END, XMLELEMENT( "stats", XMLATTRIBUTES('plan_monitor' AS "type"), NVL2(PLI.FIRST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES('first_active' AS "name"), TO_CHAR(FIRST_MOVE_TIME, :B12 )),
NULL), CASE WHEN PLI.FIRST_MOVE_TIME != PLI.FIRST_CHANGE_TIME THEN XMLELEMENT( "stat", XMLATTRIBUTES('first_row' AS "name"), TO_CHAR(FIRST_CHANGE_TIME, :B12 )) ELSE NULL END, NVL2(PLI.LAST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES('last_active' AS "name"), TO_CHAR(LAST_MOVE_TIME, :B12 )), NULL), CASE WHEN (PLI.FIRST_MOVE_TIME IS NULL OR PLI.LAST_MOVE_TIME IS NULL) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS "name"), ROUND((LAST_MOVE_TIME - FIRST_MOVE_TIME) * 3600 * 24)+1) END, CASE WHEN (PLI.OVERALL_LAST_MOVE_TIME IS NULL OR PLI.LAST_MOVE_TIME IS NULL) THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('from_most_recent' AS "name"), ROUND((PLI.OVERALL_LAST_MOVE_TIME - PLI.LAST_MOVE_TIME) * 3600 * 24)) END, NVL2(PLI.LAST_MOVE_TIME, XMLELEMENT( "stat", XMLATTRIBUTES( 'from_sql_exec_start' AS "name"), ROUND( (FIRST_MOVE_TIME - :B8 ) * 3600*24)), NU
LL), NVL2(PLI.PERCENT_COMPLETE, XMLELEMENT( "stat", XMLATTRIBUTES('percent_complete' AS "name"), PLI.PERCENT_COMPLETE), NULL), NVL2(PLI.TIME_REMAINING, XMLELEMENT( "stat", XMLATTRIBUTES('time_left' AS "name"), PLI.TIME_REMAINING), NULL), CASE WHEN PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES('starts' AS "name"), PLI.STARTS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_starts' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_STARTS/1000000), 10000), NULL) AS "iid", MOD(MAX_STARTS, 1000000) AS "sid"), TRUNC(PLI.MAX_STARTS/10000000000)) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.HAS_EXECUTED = 1 THEN XMLELEMENT( "stat", XMLATTRIBUTES('dop' AS "name"), PLI.DOP) ELSE NULL END, CASE WHEN NEED_ROWS IS NOT NULL AND PLI.FIRST_MOVE_TIME IS NOT NULL THEN XMLELEMENT( "s
tat", XMLATTRIBUTES('cardinality' AS "name"), PLI.OUTPUT_ROWS) ELSE NULL END, CASE WHEN PLI.NEED_ROWS IS NOT NULL AND PLI.DOP > 0 AND PLI.MAX_OUTPUT_ROWS IS NOT NULL AND (PLI.FIRST_MOVE_TIME IS NOT NULL) THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_card' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_OUTPUT_ROWS/1000000), 10000), NULL) AS "iid", MOD(MAX_OUTPUT_ROWS, 1000000) AS "sid"), TRUNC(PLI.MAX_OUTPUT_ROWS/10000000000)) ELSE NULL END, CASE WHEN PLI.MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('memory' AS "name"), PLI.MEM) ELSE NULL END, CASE WHEN PLI.MAX_MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('max_memory' AS "name"), PLI.MAX_MEM) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MIN_MAX_MEM IS NOT NULL AND PLI.MAX_MEM > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'min_max_mem' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MIN_MAX_MEM/10
00000), 10000), NULL) AS "iid", MOD(MIN_MAX_MEM, 1000000) AS "sid"), TRUNC(PLI.MIN_MAX_MEM/10000000000)) ELSE NULL END, CASE WHEN PLI.TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('temp' AS "name"), PLI.TEMP) ELSE NULL END, CASE WHEN PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('max_temp' AS "name"), PLI.MAX_TEMP) ELSE NULL END, CASE WHEN PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('spill_count' AS "name"), PLI.SPILL_COUNT) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_MAX_TEMP IS NOT NULL AND PLI.MAX_TEMP > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_max_temp' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_MAX_TEMP/1000000), 10000), NULL) AS "iid", MOD(MAX_MAX_TEMP, 1000000) AS "sid"), TRUNC(PLI.MAX_MAX_TEMP/10000000000)) ELSE NULL END, CASE WHEN PLI.READ_REQS > 0 THEN XMLELEMENT( "stat"
, XMLATTRIBUTES('read_reqs' AS "name"), PLI.READ_REQS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_READ_REQS IS NOT NULL AND PLI.READ_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_read_reqs' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_READ_REQS/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_READ_REQS, 1000000) AS "sid"), TRUNC(PLI.MAX_READ_REQS/10000000000)) ELSE NULL END, CASE WHEN PLI.READ_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), PLI.READ_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_READ_BYTES IS NOT NULL AND PLI.READ_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_read_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_READ_BYTES/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_READ_BYTES, 1000000) AS "sid"), TRUNC(PLI.MAX_READ_BYTES/10000000000)) ELSE NULL END, CASE
WHEN PLI.WRITE_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), PLI.WRITE_REQS) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_WRITE_REQS IS NOT NULL AND PLI.WRITE_REQS > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_write_reqs' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_WRITE_REQS/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_WRITE_REQS, 1000000) AS "sid"), TRUNC(PLI.MAX_WRITE_REQS/10000000000)) ELSE NULL END, CASE WHEN PLI.WRITE_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), PLI.WRITE_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_WRITE_BYTES IS NOT NULL AND PLI.WRITE_BYTES > 0 THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_write_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(PLI.MAX_WRITE_BYTES/1000000), 10000), NULL) AS "iid", MOD(PLI.MAX_WRITE_BYTES, 1000000) AS
"sid"), TRUNC(PLI.MAX_WRITE_BYTES/10000000000)) ELSE NULL END, CASE WHEN PLI.IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES('io_inter_bytes' AS "name"), PLI.IO_INTER_BYTES) ELSE NULL END, CASE WHEN PLI.DOP > 0 AND PLI.MAX_IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES( 'max_io_inter_bytes' AS "name", DECODE(:B67 , 'Y', MOD(TRUNC(MAX_IO_INTER_BYTES/1000000), 10000), NULL) AS "iid", MOD(MAX_IO_INTER_BYTES, 1000000) AS "sid"), TRUNC(PLI.MAX_IO_INTER_BYTES/10000000000)) ELSE NULL END, CASE WHEN PLI.IO_INTER_BYTES IS NOT NULL AND PLI.IO_BYTES > 0 AND PLI.IO_BYTES != PLI.IO_INTER_BYTES THEN XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(PLI.IO_BYTES / DECODE(PLI.IO_INTER_BYTES, 0, 1, PLI
.IO_INTER_BYTES), 2)) ELSE NULL END), NVL2(STAT_GID, XMLELEMENT( "rwsstats", XMLATTRIBUTES( PLI.STAT_GID AS "group_id"), DECODE(GID_ROWNUM, 1, (SELECT XMLELEMENT( "metadata", NULL, XMLAGG( XMLELEMENT( "stat", XMLATTRIBUTES( ROWNUM AS "id", NAME AS "name", DESCRIPTION AS "desc", TYPE AS "type", DECODE(FLAGS, 0, NULL, FLAGS) AS "flags"), NULL) ORDER BY ID)) FROM V$SQL_MONITOR_STATNAME WHERE GROUP_ID = PLI.STAT_GID), NULL), NVL2(STAT1_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(1 AS "id"), STAT1_VALUE), NULL), NVL2(STAT2_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(2 AS "id"), STAT2_VALUE), NULL), NVL2(STAT3_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(3 AS "id"), STAT3_VALUE), NULL), NVL2(STAT4_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(4 AS "id"), STAT4_VALUE), NULL), NVL2(STAT5_VALUE, XMLELE
MENT( "stat", XMLATTRIBUTES(5 AS "id"), STAT5_VALUE), NULL), NVL2(STAT6_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(6 AS "id"), STAT6_VALUE), NULL), NVL2(STAT7_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(7 AS "id"), STAT7_VALUE), NULL), NVL2(STAT8_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(8 AS "id"), STAT8_VALUE), NULL), NVL2(STAT9_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(9 AS "id"), STAT9_VALUE), NULL), NVL2(STAT10_VALUE, XMLELEMENT( "stat", XMLATTRIBUTES(10 AS "id"), STAT10_VALUE), NULL)), NULL), CASE WHEN PLI.LINE_ACTIVITY_COUNT > 0 AND :B33 = 1 THEN XMLELEMENT( "activity_sampled", XMLATTRIBUTES( TO_CHAR(PLI.LINE_ACTIVITY_START, :B12 ) AS "start_time", TO_CHAR(PLI.LINE_ACTIVITY_END, :B12 ) AS "end_time", ROUND((PLI.LINE_ACTIVITY_END - PLI.LINE_ACTIVITY_START) * 3600*24) + 1 AS "duration", PLI.L
INE_ACTIVITY_COUNT AS "count", PLI.LINE_IMQ_COUNT AS "imq_count", PLI.LINE_WAIT_COUNT AS "wait_count", PLI.LINE_CPU_COUNT AS "cpu_count", PLI.LINE_OTHER_SQL_COUNT AS "other_sql_count", :B40 AS "cpu_cores", :B39 AS "hyperthread"), PLI.ACTIVITY_TOTAL, PLI.PLAN_ACTIVITY_HISTO) ELSE NULL END) ORDER BY PLI.PLAN_LINE_ID) ) FROM (SELECT AT.MAX_LINE_ACTIVITY_COUNT, PM.OVERALL_MAX_IO_REQS, PM.OVERALL_MAX_IO_BYTES, AT.MAX_LINE_IMQ_COUNT, AT.MAX_LINE_CPU_COUNT, AT.MAX_LINE_WAIT_COUNT, AT.LINE_OTHER_SQL_COUNT, AT.MAX_LINE_OTHER_SQL_COUNT, PM.PLAN_LINE_ID, PM.PARENT_ID, PM.OPERATION, PM.OPTIONS, PM.DEPTH, PM.POSITION, PM.INACTIVE, CASE WHEN PM.OPERATION = 'PX COORDINATOR' AND :B23 = 'Y' AND (PM.PX_SERVER_SET IS NOT NULL OR AH.PX_SERVER_SET IS NOT NULL) THEN 'QC' WHEN PM.PX_SERVER_SET IS NOT NULL THEN TO_CHAR(PM.PX_SERVER_SET) WHEN AH.PX_SERVER_SET IS NOT NULL THEN TO_CHAR(AH.PX_SERVER_SET) WHEN (:B23 = 'N'
OR (PM.LAST_CHANGE_TIME IS NULL AND AT.LINE_ACTIVITY_END IS NULL)) THEN NULL ELSE 'QC' END PX_TYPE, PM.FIRST_CHANGE_TIME, AT.LINE_ACTIVITY_START, PM.LAST_CHANGE_TIME, PM.OVERALL_LAST_CHANGE_TIME, AT.LINE_ACTIVITY_END, AT.OVERALL_LINE_ACTIVITY_END, LEAST(NVL(AT.LINE_ACTIVITY_START, PM.FIRST_CHANGE_TIME), NVL(PM.FIRST_CHANGE_TIME, AT.LINE_ACTIVITY_START)) FIRST_MOVE_TIME, GREATEST(NVL(AT.LINE_ACTIVITY_END, PM.LAST_CHANGE_TIME), NVL(PM.LAST_CHANGE_TIME, AT.LINE_ACTIVITY_END)) LAST_MOVE_TIME, GREATEST(NVL(AT.OVERALL_LINE_ACTIVITY_END, PM.OVERALL_LAST_CHANGE_TIME), NVL(PM.OVERALL_LAST_CHANGE_TIME, AT.OVERALL_LINE_ACTIVITY_END)) OVERALL_LAST_MOVE_TIME, CASE WHEN PM.STARTS IS NOT NULL AND PM.STARTS > 0 THEN 1 ELSE 0 END HAS_EXECUTED, PM.OBJECT_NAME, PM.OBJECT_TYPE, PM.OBJECT_OWNER, PM.PARTITION_START, PM.PARTITION_STOP, PM.CARDINALITY, PM.BYTES, PM.COST, PM.TEMP_SPACE, PM.TIME, PM.CPU_COST, PM.IO_COST, LO.PERCENT_COMPLETE, LO.TIME_REMAINING, PM.STARTS, PM
.DOP, PM.MAX_STARTS, PM.OUTPUT_ROWS, PM.NEED_ROWS, PM.MAX_OUTPUT_ROWS, PM.MEM, PM.MAX_MEM, PM.MIN_MAX_MEM, PM.TEMP, PM.MAX_TEMP, PM.SPILL_COUNT, PM.MAX_MAX_TEMP, PM.READ_REQS, PM.MAX_READ_REQS, PM.READ_BYTES, PM.MAX_READ_BYTES, PM.WRITE_REQS, PM.MAX_WRITE_REQS, PM.WRITE_BYTES, PM.MAX_WRITE_BYTES, PM.IO_INTER_BYTES, PM.IO_BYTES, PM.MAX_IO_INTER_BYTES, AT.LINE_ACTIVITY_COUNT, AT.LINE_IMQ_COUNT, AT.LINE_WAIT_COUNT, AT.LINE_CPU_COUNT, AT.ACTIVITY_TOTAL, AH.PLAN_ACTIVITY_HISTO, PM.STAT_GID, PM.GID_ROWNUM, PM.STAT1_VALUE, PM.STAT2_VALUE, PM.STAT3_VALUE, PM.STAT4_VALUE, PM.STAT5_VALUE, PM.STAT6_VALUE, PM.STAT7_VALUE, PM.STAT8_VALUE, PM.STAT9_VALUE, PM.STAT10_VALUE FROM (SELECT AT0.*, MAX(LINE_ACTIVITY_END) OVER() OVERALL_LINE_ACTIVITY_END, MAX(LINE_ACTIVITY_COUNT) OVER() MAX_LINE_ACTIVITY_COUNT, MAX(LINE_IMQ_COUNT) OVER() MAX_LINE_IMQ_COUNT, MAX(LINE_CPU_COUNT) OVER() MAX_LINE_CPU_COUNT, MAX(LINE_WAIT_COUNT) OVER() MAX_LINE_WAIT_COUNT, MAX(LINE_OT
HER_SQL_COUNT) OVER() MAX_LINE_OTHER_SQL_COUNT FROM (SELECT AD1.PLAN_LINE_ID, MIN(AD1.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD1.LINE_ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) LINE_ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) LINE_IMQ_COUNT, SUM(AD1.WAIT_COUNT) LINE_WAIT_COUNT, SUM(AD1.OTHER_SQL_COUNT) LINE_OTHER_SQL_COUNT, SUM(AD1.CPU_COUNT) LINE_CPU_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG(XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_TOTAL FROM (SELECT AD0.PLAN_LINE_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(AD0.ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD0.ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTH
ER_SQL_COUNT, MAX(AD0.DFO_MOST_ACTIVE_IID) DFO_MOST_ACTIVE_IID, MAX(AD0.DFO_MOST_ACTIVE_SID) DFO_MOST_ACTIVE_SID, SUM(AD0.DFO_MOST_ACTIVE_COUNT) DFO_MOST_ACTIVE_COUNT FROM ASH_DATA AD0 WHERE AD0.PLAN_LINE_ID IS NOT NULL GROUP BY AD0.PLAN_LINE_ID, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.PLAN_LINE_ID) AT0) AT, (SELECT AD2.PLAN_LINE_ID, MIN(AD2.PX_SERVER_SET) PX_SERVER_SET, MIN(AD2.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD2.LINE_ACTIVITY_END) LINE_ACTIVITY_END, SUM(AD2.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD2.IMQ_COUNT) IMQ_COUNT, SUM(AD2.WAIT_COUNT) WAIT_COUNT, SUM(AD2.CPU_COUNT) CPU_COUNT, SUM(AD2.OTHER_SQL_COUNT) OTHER_SQL_COUNT, CASE WHEN :B29 = 1 AND SUM(AD2.ACTIVITY_COUNT) > 0 THEN XMLELEMENT( "activity_histogram", XMLATTRIBUTES( :B26 AS "bucket_interval", :B27 AS "bucket_count", TO_CHAR( :B20 , :B12 ) AS "start_time", TO_CHAR(:B22 , :B12 ) AS "end_time", ROUND((:B22 -:B20 ) *3600*24) + 1 AS
"duration"), XMLAGG(XMLELEMENT( "bucket", XMLATTRIBUTES( AD2.BUCKET_NUM AS "number"), AD2.ACTIVITY_BUCKET) ORDER BY AD2.BUCKET_NUM)) ELSE NULL END PLAN_ACTIVITY_HISTO FROM (SELECT AD1.PLAN_LINE_ID, AD1.BUCKET_NUM, MIN(AD1.PX_SERVER_SET) PX_SERVER_SET, MIN(AD1.LINE_ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD1.LINE_ACTIVITY_END) LINE_ACTIVITY_END, MIN(AD1.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD1.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUM(AD1.ACTIVITY_COUNT) ACTIVITY_COUNT, SUM(AD1.IMQ_COUNT) IMQ_COUNT, SUM(AD1.WAIT_COUNT) WAIT_COUNT, SUM(AD1.CPU_COUNT) CPU_COUNT, SUM(AD1.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUBSTR(MAX(LPAD(AD1.ACTIVITY_COUNT, 10)|| AD1.ACTIVITY_TYPE), 11) MOST_ACTIVE, XMLAGG(NVL2(AD1.ACTIVITY_TYPE, XMLELEMENT( "activity", XMLATTRIBUTES( AD1.ACTIVITY_TYPE AS "class", AD1.EVENT_NAME AS "event"), AD1.ACTIVITY_COUNT), NULL) ORDER BY AD1.ACTIVITY_TYPE, AD1.EVENT_NAME) ACTIVITY_BUC
KET FROM (SELECT AD0.PLAN_LINE_ID, AD0.PLAN_ACTIVITY_BUCKET_NUM BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME, MIN(NVL2(AD0.ACTIVITY_START, AD0.PX_SERVER_SET, NULL)) PX_SERVER_SET, MIN(AD0.ACTIVITY_START) LINE_ACTIVITY_START, MAX(AD0.ACTIVITY_END) LINE_ACTIVITY_END, MIN(AD0.BUCKET_ACTIVITY_START) BUCKET_ACTIVITY_START, MAX(AD0.BUCKET_ACTIVITY_END) BUCKET_ACTIVITY_END, SUM(AD0.IMQ_COUNT) IMQ_COUNT, SUM(AD0.CPU_COUNT) CPU_COUNT, SUM(AD0.WAIT_COUNT) WAIT_COUNT, SUM(AD0.OTHER_SQL_COUNT) OTHER_SQL_COUNT, SUM(AD0.ACTIVITY_COUNT) ACTIVITY_COUNT FROM ASH_DATA AD0 GROUP BY AD0.PLAN_LINE_ID, AD0.PLAN_ACTIVITY_BUCKET_NUM, AD0.ACTIVITY_TYPE, AD0.EVENT_NAME) AD1 GROUP BY AD1.PLAN_LINE_ID, AD1.BUCKET_NUM) AD2 GROUP BY AD2.PLAN_LINE_ID) AH, (SELECT LO.SQL_PLAN_LINE_ID PLAN_LINE_ID, DECODE(SUM(LO.TOTALWORK), 0, NULL, ROUND(SUM(LO.SOFAR)*100/SUM(LO.TOTALWORK))) PERCENT_COMPLETE, MAX(LO.TIME_REMAINING) TIME_REMAINING FROM GV$SESSION_LONGOPS LO, MONITOR_DATA MO WHERE (:B49 = 'Y'
OR :B70 = 'DONE (ERROR)') AND LO.SQL_ID = :B9 AND LO.SQL_EXEC_START = :B8 AND LO.SQL_EXEC_ID = :B7 AND LO.INST_ID = MO.INST_ID AND LO.SID = MO.SID GROUP BY LO.SQL_PLAN_LINE_ID) LO, (SELECT PM0.*, CASE WHEN PM0.STARTS IS NULL OR PM0.STARTS = 0 OR PM0.OUTPUT_ROWS IS NULL THEN NULL ELSE 1 END NEED_ROWS, ROW_NUMBER() OVER(PARTITION BY PM0.STAT_GID ORDER BY PM0.PLAN_LINE_ID ) GID_ROWNUM, MAX(LAST_CHANGE_TIME) OVER() OVERALL_LAST_CHANGE_TIME, MAX(MAX_IO_REQS) OVER() OVERALL_MAX_IO_REQS, MAX(MAX_IO_BYTES) OVER() OVERALL_MAX_IO_BYTES FROM (SELECT /*+ leading(mo) use_hash(plm) */ PLM.PLAN_LINE_ID PLAN_LINE_ID, PLM.PLAN_OPERATION OPERATION, PLM.PLAN_OPTIONS OPTIONS, MAX(PLM.PLAN_PARENT_ID) PARENT_ID, MAX(PLM.PLAN_DEPTH) DEPTH, MAX(PLM.PLAN_POSITION) POSITION, MAX(PLM.PLAN_OPERATION_INACTIVE) INACTIVE, MAX(PLM.PLAN_OBJECT_OWNER) OBJECT_OWNER, MAX(PLM.PLAN_OBJECT_NAME) OBJECT_NAME, MAX(PLM.PLAN_OBJECT_TYPE) OBJECT_TYPE, MAX(PLM.PLAN_COST) COST, MAX(PLM.PLAN_CARDINALITY) CARDINALI
TY, MAX(PLM.PLAN_BYTES) BYTES, MAX(PLM.PLAN_CPU_COST) CPU_COST, MAX(PLM.PLAN_IO_COST) IO_COST, MAX(PLM.PLAN_TEMP_SPACE) TEMP_SPACE, MAX(PLM.PLAN_TIME) TIME, MAX(PLM.PLAN_PARTITION_START) PARTITION_START, MAX(PLM.PLAN_PARTITION_STOP) PARTITION_STOP, MIN(PLM.FIRST_CHANGE_TIME) FIRST_CHANGE_TIME, MAX(PLM.LAST_CHANGE_TIME) LAST_CHANGE_TIME, MIN(PLM.LAST_CHANGE_TIME) MIN_LAST_CHANGE_TIME, MIN(NVL2(PLM.FIRST_CHANGE_TIME, MO.PX_SERVER_SET, NULL)) PX_SERVER_SET, COUNT(CASE WHEN PLM.PAR IS NOT NULL AND PLM.STARTS IS NOT NULL AND PLM.STARTS > 0 AND PLM.PLAN_LINE_ID != 0 AND PLM.PLAN_OPERATION != 'PX COORDINATOR' THEN 1 ELSE NULL END) DOP, SUM(PLM.STARTS) STARTS, MAX(NVL2(PAR, PLM.STARTS * 10000000000 + PLM.ES, NULL)) MAX_STARTS, SUM(PLM.OUTPUT_ROWS) OUTPUT_ROWS, MAX(NVL2(PAR, PLM.OUTPUT_ROWS * 10000000000 +PLM.ES, NULL)) MAX_OUTPUT_ROWS, SUM(PLM.WORKAREA_MEM) MEM, SUM(PLM.WORKAREA_MAX_MEM) MAX_MEM, MIN(NVL2(PAR, PLM.WORKAREA_MAX_MEM * 10000000000 + PLM.ES, NULL)) MI
N_MAX_MEM, SUM(PLM.WORKAREA_TEMPSEG) TEMP, SUM(PLM.WORKAREA_MAX_TEMPSEG) MAX_TEMP, MAX(NVL2(PAR, PLM.WORKAREA_MAX_TEMPSEG * 10000000000 + PLM.ES, NULL)) MAX_MAX_TEMP, COUNT(PLM.WORKAREA_MAX_TEMPSEG) SPILL_COUNT, SUM(PLM.PHYSICAL_READ_REQUESTS) READ_REQS, MAX(NVL2(PAR, PLM.PHYSICAL_READ_REQUESTS * 10000000000 + PLM.ES, NULL)) MAX_READ_REQS, SUM(PLM.PHYSICAL_READ_BYTES) READ_BYTES, MAX(NVL2(PAR, PLM.PHYSICAL_READ_BYTES * 10000000000 + PLM.ES, NULL)) MAX_READ_BYTES, SUM(PLM.PHYSICAL_WRITE_REQUESTS) WRITE_REQS, MAX(NVL2(PAR, PLM.PHYSICAL_WRITE_REQUESTS * 10000000000 + PLM.ES, NULL)) MAX_WRITE_REQS, SUM(PLM.PHYSICAL_WRITE_BYTES) WRITE_BYTES, MAX(NVL2(PAR, PLM.PHYSICAL_WRITE_BYTES * 10000000000 + PLM.ES, NULL)) MAX_WRITE_BYTES, NVL(SUM(PLM.PHYSICAL_READ_BYTES), 0) + NVL(SUM(PLM.PHYSICAL_WRITE_BYTES), 0) IO_BYTES, SUM(NVL(PLM.PHYSICAL_READ_REQUESTS, 0) + NVL(PLM.PHYSICAL_WRITE_REQUESTS, 0)) MAX_IO_REQS, SUM(NVL(PLM.PHYSICAL_READ_BYTES, 0) + NVL(PLM.PHYSICAL_WRITE
_BYTES, 0)) MAX_IO_BYTES, SUM(PLM.IO_INTERCONNECT_BYTES) IO_INTER_BYTES, MAX(NVL2(PAR, PLM.IO_INTERCONNECT_BYTES * 10000000000 + PLM.ES, NULL)) MAX_IO_INTER_BYTES, MAX(OTHERSTAT_GROUP_ID) STAT_GID, NVL(DECODE(MAX(OTHERSTAT_1_TYPE), 3, MAX(OTHERSTAT_1_VALUE), 4, MAX(OTHERSTAT_1_VALUE), 6, MIN(OTHERSTAT_1_VALUE), 7, MIN(OTHERSTAT_1_VALUE), NULL), SUM(DECODE(OTHERSTAT_1_TYPE, 1, OTHERSTAT_1_VALUE, 2, OTHERSTAT_1_VALUE, NULL))) STAT1_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_2_TYPE), 3, MAX(OTHERSTAT_2_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_2_VALUE), 7, MIN(RMAX1 + OTHERSTAT_2_VALUE), NULL), 6, MIN(OTHERSTAT_2_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_2_TYPE, 1, OTHERSTAT_2_VALUE, 2, OTHERSTAT_2_VALUE, NULL))) STAT2_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_3_TYPE), 3, MAX(OTHERSTAT_3_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_3_VALUE), 7, MIN(RMAX1 + OTHERSTAT_3_VALUE), NULL), 6, M
IN(OTHERSTAT_3_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_3_TYPE, 1, OTHERSTAT_3_VALUE, 2, OTHERSTAT_3_VALUE, NULL))) STAT3_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_4_TYPE), 3, MAX(OTHERSTAT_4_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_4_VALUE), 7, MIN(RMAX1 + OTHERSTAT_4_VALUE), NULL), 6, MIN(OTHERSTAT_4_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_4_TYPE, 1, OTHERSTAT_4_VALUE, 2, OTHERSTAT_4_VALUE, NULL))) STAT4_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_5_TYPE), 3, MAX(OTHERSTAT_5_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_5_VALUE), 7, MIN(RMAX1 + OTHERSTAT_5_VALUE), NULL), 6, MIN(OTHERSTAT_5_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_5_TYPE, 1, OTHERSTAT_5_VALUE, 2, OTHERSTAT_5_VALUE, NULL))) STAT5_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_6_TYPE), 3, MAX(OTHERSTAT_6_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_6_VALUE), 7, MIN(RMAX1 +
OTHERSTAT_6_VALUE), NULL), 6, MIN(OTHERSTAT_6_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_6_TYPE, 1, OTHERSTAT_6_VALUE, 2, OTHERSTAT_6_VALUE, NULL))) STAT6_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_7_TYPE), 3, MAX(OTHERSTAT_7_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_7_VALUE), 7, MIN(RMAX1 + OTHERSTAT_7_VALUE), NULL), 6, MIN(OTHERSTAT_7_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_7_TYPE, 1, OTHERSTAT_7_VALUE, 2, OTHERSTAT_7_VALUE, NULL))) STAT7_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_8_TYPE), 3, MAX(OTHERSTAT_8_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_8_VALUE), 7, MIN(RMAX1 + OTHERSTAT_8_VALUE), NULL), 6, MIN(OTHERSTAT_8_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_8_TYPE, 1, OTHERSTAT_8_VALUE, 2, OTHERSTAT_8_VALUE, NULL))) STAT8_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_9_TYPE), 3, MAX(OTHERSTAT_9_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + O
THERSTAT_9_VALUE), 7, MIN(RMAX1 + OTHERSTAT_9_VALUE), NULL), 6, MIN(OTHERSTAT_9_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_9_TYPE, 1, OTHERSTAT_9_VALUE, 2, OTHERSTAT_9_VALUE, NULL))) STAT9_VALUE, NVL(MOD((DECODE(MAX(OTHERSTAT_10_TYPE), 3, MAX(OTHERSTAT_10_VALUE), 5, DECODE(MAX(OTHERSTAT_1_TYPE), 4, MAX(RMAX1 + OTHERSTAT_10_VALUE), 7, MIN(RMAX1 + OTHERSTAT_10_VALUE), NULL), 6, MIN(OTHERSTAT_10_VALUE), NULL)), 10000000000000000), SUM(DECODE(OTHERSTAT_10_TYPE, 1, OTHERSTAT_10_VALUE, 2, OTHERSTAT_10_VALUE, NULL))) STAT10_VALUE FROM (SELECT A.*, OTHERSTAT_1_VALUE * 10000000000000000 RMAX1, A.INST_ID * 1000000 + A.SID ES, DECODE(A.PROCESS_NAME, 'ora', NULL, 1) PAR FROM GV$SQL_PLAN_MONITOR A) PLM, MONITOR_DATA MO WHERE PLM.SQL_ID = :B9 AND PLM.SQL_EXEC_START = :B8 AND PLM.SQL_EXEC_ID = :B7 AND PLM.INST_ID = MO.INST_ID AND PLM.INST_ID BETWEEN :B11 AND :B10 AND PLM.KEY = MO.KEY GROUP BY PLM.PLAN_LINE_ID, PLM.PLAN_OPERATION, PLM.PLAN_OPTION
S) PM0) PM WHERE AH.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND AT.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND LO.PLAN_LINE_ID(+) = PM.PLAN_LINE_ID AND (:B21 IS NULL OR PM.PLAN_LINE_ID = :B21 )) PLI) ELSE NULL END, CASE WHEN :B42 = 1 THEN DBMS_SQLTUNE.BUILD_STASH_XML( SESSION_ID=>:B19 , SESSION_SERIAL=>:B18 , SESSION_INST_ID=>:B17 , PX_MODE=>'yes', START_TIME=>:B20 , END_TIME=>:B22 , MISSING_SECONDS=> :B41 , INSTANCE_LOW_FILTER=>:B11 , INSTANCE_HIGH_FILTER=>:B10 , BUCKET_MAX_COUNT=>NULL, BUCKET_INTERVAL=>:B26 , REPORT_LEVEL=>'typical', CPU_CORES=>:B40 , IS_HYPER=>:B39 ) ELSE NULL END), (CASE WHEN :B38 = 1 THEN (SELECT XMLELEMENT( "skewed_sessions", XMLATTRIBUTES( DECODE(MIN(INST_ID), NULL, :B17 , MIN(INST_ID)) AS "min_iid", DECODE(MAX(INST_ID), NULL, :B17 , MAX(INST_ID)) AS "max_iid"), XMLAGG( XMLELEMENT( "s", XMLATTRIBUTES( INST_ID AS "i"), SESSION_ID) ORDER BY INST_ID, SESSION_I
D)) FROM (SELECT SESS.* FROM (SELECT DECODE(AD.DFO_MOST_ACTIVE_IID, :B17 , NULL, AD.DFO_MOST_ACTIVE_IID) INST_ID, AD.DFO_MOST_ACTIVE_SID SESSION_ID FROM ASH_DATA AD WHERE AD.DFO_MOST_ACTIVE_COUNT IS NOT NULL GROUP BY AD.DFO_MOST_ACTIVE_IID, AD.DFO_MOST_ACTIVE_SID ORDER BY MAX(AD.DFO_MOST_ACTIVE_COUNT) DESC) SESS WHERE ROWNUM <= 100)) ELSE NULL END), (CASE WHEN :B37 = 1 THEN (SELECT XMLELEMENT( "report_repository_summary", CASE WHEN MA.MAX_DBOP_NAME IS NOT NULL THEN XMLELEMENT( "dbop", XMLATTRIBUTES('F' AS "detail", MA.MAX_DBOP_NAME AS "dbop_name", TO_CHAR(MA.MIN_FIRST_REFRESH_TIME, :B12 ) AS "dbop_exec_start", MA.MAX_DBOP_EXEC_ID AS "dbop_exec_id"), XMLFOREST( MA.MAX_STATUS AS "status", TO_CHAR(NVL(MA.MAX_SQL_EXEC_START, MA.MIN_FIRST_REFRESH_TIME), :B12 )AS "first_refresh_time", TO_CHAR(MA.MAX_LAST_REFRESH_TIME, :B12 )AS "last_refresh_time", MA.SUM_REFRESH_COUNT AS "refr
esh_count", MA.MAX_INST_ID AS "inst_id", MA.MAX_SESSION_ID AS "session_id", MA.MAX_SESSION_SERIAL AS "session_serial", MA.MAX_USERID AS "user_id", MA.MAX_USERNAME AS "user", MA.MAX_CON_ID AS "con_id", MA.MAX_CON_NAME AS "con_name", MA.MAX_MODULE AS "module", MA.MAX_ACTION AS "action", MA.MAX_SERVICE_NAME AS "service", MA.MAX_CLIENT_ID AS "client_id", MA.MAX_CLIENT_INFO AS "client_info", MA.MAX_PROGRAM AS "program", MA.MAX_PL_ENTRY_OID AS "plsql_entry_object_id", MA.MAX_PL_ENTRY_PROGID AS "plsql_entry_subprogram_id", MA.MAX_PL_OID AS "plsql_object_id", MA.MAX_PL_PROGID AS "plsql_subprogram_id", MA.MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MA.MAX_PX_DOP AS "dop", MA.MAX_PX_DOP_INSTANCES AS "instances"), CASE WHEN MA.MAX_ERROR_NUMBER IS NULL THEN NULL ELSE XML
ELEMENT( "error", XMLATTRIBUTES(MA.MAX_ERROR_NUMBER AS "number", MA.MAX_ERROR_FACILITY AS "facility"), MA.MAX_ERROR_MESSAGE) END, XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS "name"), GREATEST(ROUND((MA.MAX_LAST_REFRESH_TIME- NVL(MA.MAX_SQL_EXEC_START, MA.MIN_FIRST_REFRESH_TIME))*86400), LEAST(MA.SUM_ELAPSED_TIME/1000000, 1), CEIL(MA.MAX_QUEUING_TIME/1000000))), DECODE(MA.SUM_ELAPSED_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MA.SUM_ELAPSED_TIME)), DECODE(MA.MAX_QUEUING_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MA.MAX_QUEUING_TIME)), DECODE(MA.SUM_CPU_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MA.SUM_CPU_TIME)), DECODE(MA.SUM_USER_IO_WAIT_TIME, 0, NULL, XMLELEMENT( "
stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MA.SUM_USER_IO_WAIT_TIME)), DECODE(MA.SUM_APPLICATION_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MA.SUM_APPLICATION_WAIT_TIME)), DECODE(MA.SUM_CONCURRENCY_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MA.SUM_CONCURRENCY_WAIT_TIME)), DECODE(MA.SUM_CLUSTER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MA.SUM_CLUSTER_WAIT_TIME)), DECODE(MA.SUM_PLSQL_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MA.SUM_PLSQL_EXEC_TIME)), DECODE(MA.SUM_JAVA_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MA.SUM_JAVA_EXEC_TIME)), DECODE(MA.SUM_OTHER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRI
BUTES('other_wait_time' AS "name"), MA.SUM_OTHER_WAIT_TIME)), DECODE(MA.SUM_FETCHES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MA.SUM_FETCHES)), DECODE(MA.SUM_BUFFER_GETS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"), MA.SUM_BUFFER_GETS)), DECODE(MA.SUM_READ_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MA.SUM_READ_REQS)), DECODE(MA.SUM_READ_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MA.SUM_READ_BYTES)), DECODE(MA.SUM_WRITE_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MA.SUM_WRITE_REQS)), DECODE(MA.SUM_WRITE_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MA.SUM_WRITE_BYTES)), CASE WHEN MA.SUM_IO_INTER_BYTES IS NULL OR MA.SUM_IO_INTER_BYTES = MA.SUM_IO_
BYTES OR MA.SUM_IO_BYTES = 0 THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MA.SUM_IO_BYTES / DECODE(MA.SUM_IO_INTER_BYTES, 0, 1, MA.SUM_IO_INTER_BYTES), 2)) END) ) ELSE XMLELEMENT( "sql", XMLATTRIBUTES( MA.MAX_SQL_ID AS "sql_id", TO_CHAR(MA.MAX_SQL_EXEC_START, :B12 ) AS "sql_exec_start", MA.MAX_SQL_EXEC_ID AS "sql_exec_id"), XMLFOREST(MA.MAX_STATUS AS "status", SUBSTR(MA.SQLMON_TEXT, 1, 100) AS "sql_text", TO_CHAR(MA.MIN_FIRST_REFRESH_TIME, :B12 ) AS "first_refresh_time", TO_CHAR(MA.MAX_LAST_REFRESH_TIME, :B12 ) AS "last_refresh_time", MA.SUM_REFRESH_COUNT AS "refresh_count", MA.MAX_INST_ID AS "inst_id", MA.MAX_SESSION_ID AS "session_id", MA.MAX_SESSION_SERIAL AS "session_serial", MA.MAX_USERID AS "user_id", MA.MAX_USERNAME AS "user", MA.MAX_CON_ID AS "
con_id", MA.MAX_CON_NAME AS "con_name", MA.MAX_MODULE AS "module", MA.MAX_ACTION AS "action", MA.MAX_SERVICE_NAME AS "service", MA.MAX_CLIENT_ID AS "client_id", MA.MAX_CLIENT_INFO AS "client_info", MA.MAX_PROGRAM AS "program", MA.MAX_PLAN_HASH_VALUE AS "plan_hash", MA.MAX_PL_ENTRY_OID AS "plsql_entry_object_id", MA.MAX_PL_ENTRY_PROGID AS "plsql_entry_subprogram_id", MA.MAX_PL_OID AS "plsql_object_id", MA.MAX_PL_PROGID AS "plsql_subprogram_id", MA.MAX_PX_IS_CROSS_INSTANCE AS "is_cross_instance", MA.MAX_PX_DOP AS "dop", MA.MAX_PX_DOP_INSTANCES AS "instances", MA.SUM_SERVERS_REQUESTED AS "px_servers_requested", MA.SUM_SERVERS_ALLOCATED AS "px_servers_allocated"), XMLELEMENT( "stats", XMLATTRIBUTES('monitor' AS "type"), XMLELEMENT( "stat", XMLATTRIBUTES('duration' AS
"name"), GREATEST(ROUND((MA.MAX_LAST_REFRESH_TIME- MA.MAX_SQL_EXEC_START)*86400), LEAST(MA.SUM_ELAPSED_TIME/1000000, 1), CEIL(MA.MAX_QUEUING_TIME/1000000))), DECODE(MA.SUM_ELAPSED_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('elapsed_time' AS "name"), MA.SUM_ELAPSED_TIME)), DECODE(MA.MAX_QUEUING_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('queuing_time' AS "name"), MA.MAX_QUEUING_TIME)), DECODE(MA.SUM_CPU_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cpu_time' AS "name"), MA.SUM_CPU_TIME)), DECODE(MA.SUM_USER_IO_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_io_wait_time' AS "name"), MA.SUM_USER_IO_WAIT_TIME)), DECODE(MA.SUM_APPLICATION_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('application_wait_time' AS "name"), MA.SUM_APPLICATION_WAIT_TIME)), DECODE(MA.SUM_CONCURRENCY_WAIT_TIME, 0, NULL, XMLELEMENT(
"stat", XMLATTRIBUTES('concurrency_wait_time' AS "name"), MA.SUM_CONCURRENCY_WAIT_TIME)), DECODE(MA.SUM_CLUSTER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('cluster_wait_time' AS "name"), MA.SUM_CLUSTER_WAIT_TIME)), DECODE(MA.SUM_PLSQL_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('plsql_exec_time' AS "name"), MA.SUM_PLSQL_EXEC_TIME)), DECODE(MA.SUM_JAVA_EXEC_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('java_exec_time' AS "name"), MA.SUM_JAVA_EXEC_TIME)), DECODE(MA.SUM_OTHER_WAIT_TIME, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('other_wait_time' AS "name"), MA.SUM_OTHER_WAIT_TIME)), DECODE(MA.SUM_FETCHES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('user_fetch_count' AS "name"), MA.SUM_FETCHES)), DECODE(MA.SUM_BUFFER_GETS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('buffer_gets' AS "name"),
MA.SUM_BUFFER_GETS)), DECODE(MA.SUM_READ_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_reqs' AS "name"), MA.SUM_READ_REQS)), DECODE(MA.SUM_READ_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('read_bytes' AS "name"), MA.SUM_READ_BYTES)), DECODE(MA.SUM_WRITE_REQS, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_reqs' AS "name"), MA.SUM_WRITE_REQS)), DECODE(MA.SUM_WRITE_BYTES, 0, NULL, XMLELEMENT( "stat", XMLATTRIBUTES('write_bytes' AS "name"), MA.SUM_WRITE_BYTES)), CASE WHEN MA.SUM_IO_INTER_BYTES IS NULL OR MA.SUM_IO_INTER_BYTES = MA.SUM_IO_BYTES OR MA.SUM_IO_BYTES = 0 THEN NULL ELSE XMLELEMENT( "stat", XMLATTRIBUTES('cell_offload_efficiency' AS "name"), ROUND(MA.SUM_IO_BYTES / DECODE(MA.SUM_IO_INTER_BYTES, 0, 1, MA.SUM_IO_INTER_BYTES), 2)) END) ) END) FROM MONITOR_AGG MA) ELSE NULL END) FROM (SELECT CASE WHEN V1.XPLAN_XML IS NULL OR V1.XPLAN_
XML.EXISTSNODE('/error') > 0 THEN NULL ELSE V1.XPLAN_XML END XPLAN_XML FROM (SELECT CASE WHEN :B36 = 1 THEN DBMS_XPLAN.BUILD_PLAN_XML(TABLE_NAME=>'gv$sql_plan', PLAN_TAG=>'plan', FILTER_PREDS=>:B35 , FORMAT=>'-PROJECTION +ALIAS +ADAPTIVE') ELSE NULL END XPLAN_XML FROM DUAL) V1) CONST_VIEW |
f34b5tdsqan32 |
SELECT /*+ ORDERED NO_EXPAND USE_NL(qpq qplatq qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N6)
index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE,
:B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID, QUALIFIER_GROUPING_NO FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = QPTQ.QUALIFIER_GROUPING_NO AND QPQ.QUALIFIER_GROUPING_NO <> -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRI
BUTE = QPLATQ.ATTRIBUTE AND QPQ.QUALIFIER_ATTR_VALUE = QPLATQ.VALUE_FROM AND QPQ.COMPARISON_OPERATOR_CODE = '=' AND QPQ.SEARCH_IND = 2 AND QPQ.QUALIFIER_GROUP_CNT > 1 AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(q
pq qplatq qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N6) index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_o
uter_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID
|| '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.QUALIFIER_ATTR_VALUE = QPLATQ.VALUE_FROM AND QPQ.COMPARISON_OPERATOR_CODE = '=' AND QPQ.SEARCH_IND =
2 AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplatq qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N6) index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID,
QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START
_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID, QUALIFIER_GROUPING_NO FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = QPTQ.QUALIFIER_GROUPING_NO AND QPQ.QUALIFIER_GROUPING_NO <> -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B12 AND QPQ.QUALIFIER_DATATYPE = :B11 AND QPQ.SEARCH_IND = 2 AND QPQ.QUALIFIER_GROUP_CNT > 1 AND QP_NUMBER.CANONICAL_TO_NUMBER(DECODE(QPQ.QUALIFIER_D
ATATYPE, :B11 , QPLATQ.VALUE_FROM, NULL)) BETWEEN QPQ.QUAL_ATTR_VALUE_FROM_NUMBER AND QPQ.QUAL_ATTR_VALUE_TO_NUMBER AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplatq qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N
6) index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_ou
ter_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROU
PING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B12 AND QPQ.QUALIFIER_DATATYPE = :B11 AND QPQ.SEARCH_IND = 2 AND QP_NUMBER.CANONICAL_TO_NUMBER(DECODE(QPQ.QUALIFIER_DATATYPE, :
B11 , QPLATQ.VALUE_FROM, NULL)) BETWEEN QPQ.QUAL_ATTR_VALUE_FROM_NUMBER AND QPQ.QUAL_ATTR_VALUE_TO_NUMBER AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplatq qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N6) index(q
pq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNI
QUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID, QUALIFIER_GROUPING_NO FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = QPTQ.QUALIFIER_GROUPING_NO AND QPQ.QUALIFIER_GROUPING_NO <> -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B12 AND QPQ.SEARCH_IND = 2 AND QPQ.QUALIFIER_GROU
P_CNT > 1 AND QPQ.QUALIFIER_DATATYPE IN (:B15 , :B14 , :B13 ) AND QPLATQ.VALUE_FROM BETWEEN QPQ.QUALIFIER_ATTR_VALUE AND QPQ.QUALIFIER_ATTR_VALUE_TO AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND QPH.ACTIVE_FLAG = :B5 AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.ACTIVE_FLAG = :B5 AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) inde
x (qplatq, QP_PREQ_LINE_ATTRS_TMP_N6) index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l_mini_out
er_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_L
INE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = :B12 AND QPQ.SEARCH_IND = 2 AND QPQ.QUALIFIER_DATATYPE IN (:B15 , :B14 , :B13 ) AND QPLATQ.VA
LUE_FROM BETWEEN QPQ.QUALIFIER_ATTR_VALUE AND QPQ.QUALIFIER_ATTR_VALUE_TO AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND QPH.ACTIVE_FLAG = :B5 AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPQ.ACTIVE_FLAG = :B5 AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N7)
index(qpq qp_qualifiers_n1) index
(qph qp_list_headers_b_n7) l_mini_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_A
CTIVE START_DATE_ACTIVE_H, QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID, QUALIFIER_GROUPING_NO FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = QPTQ.QUALIFIER_GROUPING_NO AND QPQ.QUALIFIER_GROUPING_NO <> -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =' AND QPQ.QUALIFIER_ATTR_VALUE <> QPLATQ.VALUE_FROM AND QPQ.SEAR
CH_IND = 2 AND QPQ.QUALIFIER_GROUP_CNT > 1 AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(QPH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) UNION ALL SELECT /*+ ORDERED USE_NL(qpq qplh qph) index (qplatq, QP_PREQ_LINE_ATTRS_TMP_N7)
index(qpq qp_qualifiers_n1) index(qph qp_list_headers_b_n7) l
_mini_outer_qual_cur_mod */ QPQ.LIST_HEADER_ID, QPQ.LIST_LINE_ID LIST_LINE_ID, QPQ.QUALIFIER_GROUP_CNT, QPQ.OTHERS_GROUP_CNT, QPQ.HEADER_QUALS_EXIST_FLAG, QPQ.SEARCH_IND, :B9 VALIDATED_FLAG, :B9 APPLIED_FLAG, :B10 ATTRIBUTE_LEVEL, :B4 ATTRIBUTE_TYPE, QPLATQ.CONTEXT , QPLATQ.ATTRIBUTE , QPLATQ.VALUE_FROM , QPQ.QUALIFIER_GROUPING_NO QUALIFIER_GROUPING_NO , QPQ.QUALIFIER_PRECEDENCE , QPQ.QUALIFIER_DATATYPE, QPQ.QUALIFIER_ATTR_VALUE , QPQ.QUALIFIER_ATTR_VALUE_TO , QPQ.START_DATE_ACTIVE, QPQ.END_DATE_ACTIVE, :B9 PRICING_ATTR_FLAG, QPQ.COMPARISON_OPERATOR_CODE , QPH.LIST_TYPE_CODE, QPH.ASK_FOR_FLAG, QPLATQ.PRICING_STATUS_CODE, 'OHQ1' , NULL LINE_INDEX, NULL PRICING_EFFECTIVE_DATE, QPH.START_DATE_ACTIVE_FIRST START_DATE_ACTIVE_FIRST, QPH.END_DATE_ACTIVE_FIRST END_DATE_ACTIVE_FIRST, NULL LINE_TYPE_CODE, :B1 PRICING_PHASE_ID, QPQ.LIST_HEADER_ID || '-' || QPQ.LIST_LINE_ID || '-' || QPQ.QUALIFIER_GROUPING_NO UNIQUE_KEY, QPH.START_DATE_ACTIVE START_DATE_ACTIVE_H,
QPH.END_DATE_ACTIVE END_DATE_ACTIVE_H, QPH.START_DATE_ACTIVE_SECOND START_DATE_ACTIVE_SECOND, QPH.END_DATE_ACTIVE_SECOND END_DATE_ACTIVE_SECOND, QPH.ACTIVE_DATE_FIRST_TYPE, QPH.ACTIVE_DATE_SECOND_TYPE, QPH.LIMIT_EXISTS_FLAG, QPLATQ.DERIVED_QUALIFIER_FLAG FROM (SELECT /*+ index(qp_preq_qual_tmp QP_PREQ_QUAL_TMP_N7) */ DISTINCT LIST_HEADER_ID, LIST_LINE_ID FROM QP_PREQ_QUAL_TMP WHERE PRICING_STATUS_CODE = :B2 AND PRICING_PHASE_ID = :B1 ) QPTQ, QP_QUALIFIERS QPQ , QP_NPREQ_LINE_ATTRS_TMP QPLATQ, QP_LIST_HEADERS_B QPH, QP_PRICE_REQ_SOURCES_V QPRS WHERE QPQ.LIST_HEADER_ID = QPTQ.LIST_HEADER_ID AND QPQ.LIST_LINE_ID = QPTQ.LIST_LINE_ID AND QPQ.QUALIFIER_GROUPING_NO = -1 AND QPQ.QUALIFIER_CONTEXT = QPLATQ.CONTEXT AND QPQ.QUALIFIER_ATTRIBUTE = QPLATQ.ATTRIBUTE AND QPQ.COMPARISON_OPERATOR_CODE = 'NOT =' AND QPQ.QUALIFIER_ATTR_VALUE <> QPLATQ.VALUE_FROM AND QPQ.SEARCH_IND = 2 AND ((QPH.CURRENCY_CODE IS NOT NULL AND QPH.CURRENCY_CODE = :B8 ) OR QPH.CURRENCY_CODE IS NULL) AND (NVL(Q
PH.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPH.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND (NVL(QPQ.END_DATE_ACTIVE, :B7 ) >= :B7 AND NVL(QPQ.START_DATE_ACTIVE, :B6 ) <= :B6 ) AND QPH.LIST_TYPE_CODE NOT IN ('PRL', 'AGR') AND QPH.ACTIVE_FLAG = :B5 AND QPQ.ACTIVE_FLAG = :B5 AND QPQ.LIST_HEADER_ID = QPH.LIST_HEADER_ID AND QPLATQ.LINE_INDEX > 0 AND QPLATQ.DISTINCT_QUALIFIER_FLAG = :B5 AND QPLATQ.PRICING_STATUS_CODE = :B2 AND QPLATQ.ATTRIBUTE_TYPE = :B4 AND QPRS.REQUEST_TYPE_CODE = :B3 AND QPH.SOURCE_SYSTEM_CODE = QPRS.SOURCE_SYSTEM_CODE AND ((NVL(QPLATQ.DERIVED_QUALIFIER_FLAG, 'N') = 'N') OR (QPLATQ.DERIVED_QUALIFIER_FLAG = 'Y' AND QPQ.QUALIFY_HIER_DESCENDENTS_FLAG = 'Y')) |
fbxfzbmhtvfgc | select count(descriptive_flex_context_code) l_context_count from fnd_descr_flex_contexts where application_id = 7003 and descriptive_flexfield_name = :1 and substr(descriptive_flex_context_code, 4, 2) = :2 and substr(descriptive_flex_context_code, 7, 8) = :3 and enabled_flag = 'Y' |
gb08md4fuqfv2 | SELECT SHIPPABLE_ITEM_FLAG , ORGANIZATION_ID , RESTRICT_SUBINVENTORIES_CODE , ONT_PRICING_QTY_SOURCE , TRACKING_QUANTITY_IND , DECODE (:B4 , 'Y', REPLENISH_TO_ORDER_FLAG, :B3 ) , SECONDARY_UOM_CODE , SECONDARY_DEFAULT_IND , LOT_DIVISIBLE_FLAG , GRADE_CONTROL_FLAG , LOT_CONTROL_CODE , RETURNABLE_FLAG , PRIMARY_UOM_CODE FROM MTL_SYSTEM_ITEMS WHERE INVENTORY_ITEM_ID = :B2 AND ORGANIZATION_ID = :B1 |
gmmq9hrnkkssh | Select distinct LOOKUP_CODE tax_code, description, tax_type From zx_output_classifications_v Where lookup_type = 'ZX_OUTPUT_CLASSIFICATIONS' and org_id in (:1, -99) and enabled_flag = 'Y' and :2 between nvl(start_date_active, :3) and nvl(end_date_active, :4) |