The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT ACCOUNTING_RULE_ID
, AGREEMENT_ID
, ATTRIBUTE1
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, ATTRIBUTE16
, ATTRIBUTE17
, ATTRIBUTE18
, ATTRIBUTE19
, ATTRIBUTE20
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, CONTEXT
, CREATED_BY
, CREATION_DATE
, CUST_PO_NUMBER
, DELIVER_TO_ORG_ID
, FREIGHT_TERMS_CODE
, header_id
, INVOICE_TO_ORG_ID
, INVOICING_RULE_ID
, LAST_UPDATED_BY
, LAST_UPDATE_DATE
, LAST_UPDATE_LOGIN
, bh.ORDER_NUMBER
, ORDER_TYPE_ID
, ORG_ID
, PAYMENT_TERM_ID
, PRICE_LIST_ID
, PROGRAM_APPLICATION_ID
, PROGRAM_ID
, PROGRAM_UPDATE_DATE
, REQUEST_ID
, SALESREP_ID
, SHIPPING_METHOD_CODE
, ship_from_org_id
, SHIP_TO_ORG_ID
, SOLD_TO_CONTACT_ID
, SOLD_TO_ORG_ID
, TRANSACTIONAL_CURR_CODE
, conversion_type_code
, LOCK_CONTROL
, VERSION_NUMBER
, SHIPPING_INSTRUCTIONS
, PACKING_INSTRUCTIONS
, START_DATE_ACTIVE
, END_DATE_ACTIVE
, on_hold_flag
, ENFORCE_PRICE_LIST_FLAG
, enforce_ship_to_flag
, enforce_invoice_to_flag
, enforce_freight_term_flag
, enforce_shipping_method_flag
, enforce_payment_term_flag
, enforce_accounting_rule_flag
, enforce_invoicing_rule_flag
, OVERRIDE_AMOUNT_FLAG
, BLANKET_MAX_AMOUNT
, BLANKET_MIN_AMOUNT
, RELEASED_AMOUNT
, FULFILLED_AMOUNT
, RETURNED_AMOUNT
, source_document_id
, source_document_type_id
, SALES_DOCUMENT_NAME
, TRANSACTION_PHASE_CODE
, USER_STATUS_CODE
, FLOW_STATUS_CODE
, SUPPLIER_SIGNATURE
, SUPPLIER_SIGNATURE_DATE
, CUSTOMER_SIGNATURE
, CUSTOMER_SIGNATURE_DATE
, sold_to_site_use_id
, draft_submitted_flag
, source_document_version_number
, new_price_list_id
, new_modifier_list_id
, default_discount_percent
, default_discount_amount
INTO x_header_rec.ACCOUNTING_RULE_ID
,x_header_rec.AGREEMENT_ID
,x_header_rec.ATTRIBUTE1
,x_header_rec.ATTRIBUTE10
,x_header_rec.ATTRIBUTE11
,x_header_rec.ATTRIBUTE12
,x_header_rec.ATTRIBUTE13
,x_header_rec.ATTRIBUTE14
,x_header_rec.ATTRIBUTE15
,x_header_rec.ATTRIBUTE16
,x_header_rec.ATTRIBUTE17
,x_header_rec.ATTRIBUTE18
,x_header_rec.ATTRIBUTE19
,x_header_rec.ATTRIBUTE20
,x_header_rec.ATTRIBUTE2
,x_header_rec.ATTRIBUTE3
,x_header_rec.ATTRIBUTE4
,x_header_rec.ATTRIBUTE5
,x_header_rec.ATTRIBUTE6
,x_header_rec.ATTRIBUTE7
,x_header_rec.ATTRIBUTE8
,x_header_rec.ATTRIBUTE9
,x_header_rec.CONTEXT
,x_header_rec.CREATED_BY
,x_header_rec.CREATION_DATE
,x_header_rec.CUST_PO_NUMBER
,x_header_rec.DELIVER_TO_ORG_ID
,x_header_rec.FREIGHT_TERMS_CODE
,x_header_rec.header_id
,x_header_rec.INVOICE_TO_ORG_ID
,x_header_rec.INVOICING_RULE_ID
,x_header_rec.LAST_UPDATED_BY
,x_header_rec.LAST_UPDATE_DATE
,x_header_rec.LAST_UPDATE_LOGIN
,x_header_rec.ORDER_NUMBER
,x_header_rec.ORDER_TYPE_ID
,x_header_rec.ORG_ID
,x_header_rec.PAYMENT_TERM_ID
,x_header_rec.PRICE_LIST_ID
,x_header_rec.PROGRAM_APPLICATION_ID
,x_header_rec.PROGRAM_ID
,x_header_rec.PROGRAM_UPDATE_DATE
,x_header_rec.REQUEST_ID
,x_header_rec.SALESREP_ID
,x_header_rec.SHIPPING_METHOD_CODE
,x_header_rec.ship_from_org_id
,x_header_rec.SHIP_TO_ORG_ID
,x_header_rec.SOLD_TO_CONTACT_ID
,x_header_rec.SOLD_TO_ORG_ID
,x_header_rec.TRANSACTIONAL_CURR_CODE
,x_header_rec.conversion_type_code
,x_header_rec.LOCK_CONTROL
,x_header_rec.VERSION_NUMBER
,x_header_rec.SHIPPING_INSTRUCTIONS
,x_header_rec.PACKING_INSTRUCTIONS
,x_header_rec.START_DATE_ACTIVE
,x_header_rec.END_DATE_ACTIVE
,x_header_rec.on_hold_flag
,x_header_rec.ENFORCE_PRICE_LIST_FLAG
,x_header_rec.enforce_ship_to_flag
,x_header_rec.enforce_invoice_to_flag
,x_header_rec.enforce_freight_term_flag
,x_header_rec.enforce_shipping_method_flag
,x_header_rec.enforce_payment_term_flag
,x_header_rec.enforce_accounting_rule_flag
,x_header_rec.enforce_invoicing_rule_flag
,x_header_rec.OVERRIDE_AMOUNT_FLAG
,x_header_rec.BLANKET_MAX_AMOUNT
,x_header_rec.BLANKET_MIN_AMOUNT
,x_header_rec.RELEASED_AMOUNT
,x_header_rec.FULFILLED_AMOUNT
,x_header_rec.RETURNED_AMOUNT
,x_header_rec.source_document_id
,x_header_rec.source_document_type_id
,x_header_rec.SALES_DOCUMENT_NAME
,x_header_rec.TRANSACTION_PHASE_CODE
,x_header_rec.USER_STATUS_CODE
,x_header_rec.FLOW_STATUS_CODE
,x_header_rec.SUPPLIER_SIGNATURE
,x_header_rec.SUPPLIER_SIGNATURE_DATE
,x_header_rec.CUSTOMER_SIGNATURE
,x_header_rec.CUSTOMER_SIGNATURE_DATE
,x_header_rec.sold_to_site_use_id
,x_header_rec.draft_submitted_flag
,x_header_rec.source_document_version_number
,x_header_rec.new_price_list_id
,x_header_rec.new_modifier_list_id
,x_header_rec.default_discount_percent
,x_header_rec.default_discount_amount
FROM OE_BLANKET_HEADERS_HIST bh
WHERE bh.header_id = p_header_id
AND bh.sales_document_type_code = 'B'
AND bh.version_number = p_version
AND (PHASE_CHANGE_FLAG = p_phase_change_flag
OR (nvl(p_phase_change_flag, 'NULL') <> 'Y'
AND VERSION_FLAG = 'Y'));
SELECT ACCOUNTING_RULE_ID
, AGREEMENT_ID
, ATTRIBUTE1
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, ATTRIBUTE16
, ATTRIBUTE17
, ATTRIBUTE18
, ATTRIBUTE19
, ATTRIBUTE20
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, CONTEXT
, CREATED_BY
, CREATION_DATE
, CUST_PO_NUMBER
, DELIVER_TO_ORG_ID
, FREIGHT_TERMS_CODE
, header_id
, INVOICE_TO_ORG_ID
, INVOICING_RULE_ID
, LAST_UPDATED_BY
, LAST_UPDATE_DATE
, LAST_UPDATE_LOGIN
, bh.ORDER_NUMBER
, ORDER_TYPE_ID
, ORG_ID
, PAYMENT_TERM_ID
, PRICE_LIST_ID
, PROGRAM_APPLICATION_ID
, PROGRAM_ID
, PROGRAM_UPDATE_DATE
, REQUEST_ID
, SALESREP_ID
, SHIPPING_METHOD_CODE
, ship_from_org_id
, SHIP_TO_ORG_ID
, SOLD_TO_CONTACT_ID
, SOLD_TO_ORG_ID
, TRANSACTIONAL_CURR_CODE
, conversion_type_code
, LOCK_CONTROL
, VERSION_NUMBER
, SHIPPING_INSTRUCTIONS
, PACKING_INSTRUCTIONS
, START_DATE_ACTIVE
, END_DATE_ACTIVE
, on_hold_flag
, ENFORCE_PRICE_LIST_FLAG
, enforce_ship_to_flag
, enforce_invoice_to_flag
, enforce_freight_term_flag
, enforce_shipping_method_flag
, enforce_payment_term_flag
, enforce_accounting_rule_flag
, enforce_invoicing_rule_flag
, OVERRIDE_AMOUNT_FLAG
, BLANKET_MAX_AMOUNT
, BLANKET_MIN_AMOUNT
, RELEASED_AMOUNT
, FULFILLED_AMOUNT
, RETURNED_AMOUNT
, source_document_id
, source_document_type_id
, SALES_DOCUMENT_NAME
, TRANSACTION_PHASE_CODE
, USER_STATUS_CODE
, FLOW_STATUS_CODE
, SUPPLIER_SIGNATURE
, SUPPLIER_SIGNATURE_DATE
, CUSTOMER_SIGNATURE
, CUSTOMER_SIGNATURE_DATE
, sold_to_site_use_id
, draft_submitted_flag
, source_document_version_number
, new_price_list_id
, new_modifier_list_id
, default_discount_percent
, default_discount_amount
INTO
x_header_rec.ACCOUNTING_RULE_ID
,x_header_rec.AGREEMENT_ID
,x_header_rec.ATTRIBUTE1
,x_header_rec.ATTRIBUTE10
,x_header_rec.ATTRIBUTE11
,x_header_rec.ATTRIBUTE12
,x_header_rec.ATTRIBUTE13
,x_header_rec.ATTRIBUTE14
,x_header_rec.ATTRIBUTE15
,x_header_rec.ATTRIBUTE16
,x_header_rec.ATTRIBUTE17
,x_header_rec.ATTRIBUTE18
,x_header_rec.ATTRIBUTE19
,x_header_rec.ATTRIBUTE20
,x_header_rec.ATTRIBUTE2
,x_header_rec.ATTRIBUTE3
,x_header_rec.ATTRIBUTE4
,x_header_rec.ATTRIBUTE5
,x_header_rec.ATTRIBUTE6
,x_header_rec.ATTRIBUTE7
,x_header_rec.ATTRIBUTE8
,x_header_rec.ATTRIBUTE9
,x_header_rec.CONTEXT
,x_header_rec.CREATED_BY
,x_header_rec.CREATION_DATE
,x_header_rec.CUST_PO_NUMBER
,x_header_rec.DELIVER_TO_ORG_ID
,x_header_rec.FREIGHT_TERMS_CODE
,x_header_rec.header_id
,x_header_rec.INVOICE_TO_ORG_ID
,x_header_rec.INVOICING_RULE_ID
,x_header_rec.LAST_UPDATED_BY
,x_header_rec.LAST_UPDATE_DATE
,x_header_rec.LAST_UPDATE_LOGIN
,x_header_rec.ORDER_NUMBER
,x_header_rec.ORDER_TYPE_ID
,x_header_rec.ORG_ID
,x_header_rec.PAYMENT_TERM_ID
,x_header_rec.PRICE_LIST_ID
,x_header_rec.PROGRAM_APPLICATION_ID
,x_header_rec.PROGRAM_ID
,x_header_rec.PROGRAM_UPDATE_DATE
,x_header_rec.REQUEST_ID
,x_header_rec.SALESREP_ID
,x_header_rec.SHIPPING_METHOD_CODE
,x_header_rec.ship_from_org_id
,x_header_rec.SHIP_TO_ORG_ID
,x_header_rec.SOLD_TO_CONTACT_ID
,x_header_rec.SOLD_TO_ORG_ID
,x_header_rec.TRANSACTIONAL_CURR_CODE
,x_header_rec.conversion_type_code
,x_header_rec.LOCK_CONTROL
,x_header_rec.VERSION_NUMBER
,x_header_rec.SHIPPING_INSTRUCTIONS
,x_header_rec.PACKING_INSTRUCTIONS
,x_header_rec.START_DATE_ACTIVE
,x_header_rec.END_DATE_ACTIVE
,x_header_rec.on_hold_flag
,x_header_rec.ENFORCE_PRICE_LIST_FLAG
,x_header_rec.enforce_ship_to_flag
,x_header_rec.enforce_invoice_to_flag
,x_header_rec.enforce_freight_term_flag
,x_header_rec.enforce_shipping_method_flag
,x_header_rec.enforce_payment_term_flag
,x_header_rec.enforce_accounting_rule_flag
,x_header_rec.enforce_invoicing_rule_flag
,x_header_rec.OVERRIDE_AMOUNT_FLAG
,x_header_rec.BLANKET_MAX_AMOUNT
,x_header_rec.BLANKET_MIN_AMOUNT
,x_header_rec.RELEASED_AMOUNT
,x_header_rec.FULFILLED_AMOUNT
,x_header_rec.RETURNED_AMOUNT
,x_header_rec.source_document_id
,x_header_rec.source_document_type_id
,x_header_rec.SALES_DOCUMENT_NAME
,x_header_rec.TRANSACTION_PHASE_CODE
,x_header_rec.USER_STATUS_CODE
,x_header_rec.FLOW_STATUS_CODE
,x_header_rec. SUPPLIER_SIGNATURE
,x_header_rec.SUPPLIER_SIGNATURE_DATE
,x_header_rec.CUSTOMER_SIGNATURE
,x_header_rec.CUSTOMER_SIGNATURE_DATE
,x_header_rec.sold_to_site_use_id
,x_header_rec.draft_submitted_flag
,x_header_rec.source_document_version_number
,x_header_rec.new_price_list_id
,x_header_rec.new_modifier_list_id
,x_header_rec.default_discount_percent
,x_header_rec.default_discount_amount
FROM OE_BLANKET_HEADERS bh, OE_BLANKET_HEADERS_EXT bhx
WHERE bh.order_number = bhx.order_number
AND bh.sales_document_type_code = 'B'
AND bh.HEADER_ID = p_header_id
AND bh.VERSION_NUMBER = p_version;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_current_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_prior_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_prior_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_current_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_next_deliver_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_current_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_prior_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_prior_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_current_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_next_invoice_to_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_current_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_prior_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_prior_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_current_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_next_ship_from_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_current_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_prior_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_prior_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_current_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_next_ship_to_address from dual;
select
DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
into x_current_sold_to_location from dual;
select
DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
into x_prior_sold_to_location from dual;
select
DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
into x_prior_sold_to_location from dual;
select
DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
into x_current_sold_to_location from dual;
select
DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
into x_next_sold_to_location from dual;
SELECT ACCOUNTING_RULE_ID
, AGREEMENT_ID
, ATTRIBUTE1
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, CONTEXT
, CREATED_BY
, CREATION_DATE
, CUST_PO_NUMBER
, DELIVER_TO_ORG_ID
, FREIGHT_TERMS_CODE
, header_id
, min_release_quantity
, max_release_quantity
, inventory_item_id
, INVOICE_TO_ORG_ID
, INVOICING_RULE_ID
, ORDERED_ITEM_ID
, item_identifier_type
, ORDERED_ITEM
, ITEM_TYPE_CODE
, LAST_UPDATED_BY
, LAST_UPDATE_DATE
, LAST_UPDATE_LOGIN
, line_id
, line_number
, PAYMENT_TERM_ID
, PREFERRED_GRADE
, PRICE_LIST_ID
, PROGRAM_APPLICATION_ID
, PROGRAM_ID
, PROGRAM_UPDATE_DATE
, REQUEST_ID
, SALESREP_ID
, SHIPPING_METHOD_CODE
, ship_from_org_id
, SHIP_TO_ORG_ID
, SHIPPING_INSTRUCTIONS
, PACKING_INSTRUCTIONS
, START_DATE_ACTIVE
, END_DATE_ACTIVE
, MAX_RELEASE_AMOUNT
, MIN_RELEASE_AMOUNT
, BLANKET_LINE_MAX_AMOUNT
, BLANKET_LINE_MIN_AMOUNT
, BLANKET_MAX_QUANTITY
, BLANKET_MIN_QUANTITY
, OVERRIDE_BLANKET_CONTROLS_FLAG
, OVERRIDE_RELEASE_CONTROLS_FLAG
, ENFORCE_PRICE_LIST_FLAG
, enforce_ship_to_flag
, enforce_invoice_to_flag
, enforce_freight_term_flag
, enforce_shipping_method_flag
, enforce_payment_term_flag
, enforce_accounting_rule_flag
, enforce_invoicing_rule_flag
, ORDER_QUANTITY_UOM
, RELEASED_QUANTITY
, FULFILLED_QUANTITY
, RETURNED_QUANTITY
, ORDER_NUMBER
, RELEASED_AMOUNT
, FULFILLED_AMOUNT
, RETURNED_AMOUNT
, TRANSACTION_PHASE_CODE
, source_document_version_number
, modifier_list_line_id
INTO
x_line_rec.ACCOUNTING_RULE_ID
,x_line_rec.AGREEMENT_ID
,x_line_rec.ATTRIBUTE1
,x_line_rec.ATTRIBUTE10
,x_line_rec.ATTRIBUTE11
,x_line_rec.ATTRIBUTE12
,x_line_rec.ATTRIBUTE13
,x_line_rec.ATTRIBUTE14
,x_line_rec.ATTRIBUTE15
,x_line_rec.ATTRIBUTE2
,x_line_rec.ATTRIBUTE3
,x_line_rec.ATTRIBUTE4
,x_line_rec.ATTRIBUTE5
,x_line_rec.ATTRIBUTE6
,x_line_rec.ATTRIBUTE7
,x_line_rec.ATTRIBUTE8
,x_line_rec.ATTRIBUTE9
,x_line_rec.CONTEXT
,x_line_rec.CREATED_BY
,x_line_rec.CREATION_DATE
,x_line_rec.CUST_PO_NUMBER
,x_line_rec.DELIVER_TO_ORG_ID
,x_line_rec.FREIGHT_TERMS_CODE
,x_line_rec.header_id
,x_line_rec.min_release_quantity
,x_line_rec.max_release_quantity
,x_line_rec.inventory_item_id
,x_line_rec.INVOICE_TO_ORG_ID
,x_line_rec.INVOICING_RULE_ID
,x_line_rec.ORDERED_ITEM_ID
,x_line_rec.item_identifier_type
,x_line_rec.ORDERED_ITEM
,x_line_rec.ITEM_TYPE_CODE
,x_line_rec.LAST_UPDATED_BY
,x_line_rec.LAST_UPDATE_DATE
,x_line_rec.LAST_UPDATE_LOGIN
,x_line_rec.line_id
,x_line_rec.line_number
,x_line_rec.PAYMENT_TERM_ID
,x_line_rec.PREFERRED_GRADE
,x_line_rec.PRICE_LIST_ID
,x_line_rec.PROGRAM_APPLICATION_ID
,x_line_rec.PROGRAM_ID
,x_line_rec.PROGRAM_UPDATE_DATE
,x_line_rec.REQUEST_ID
,x_line_rec.SALESREP_ID
,x_line_rec.SHIPPING_METHOD_CODE
,x_line_rec.ship_from_org_id
,x_line_rec.SHIP_TO_ORG_ID
,x_line_rec.SHIPPING_INSTRUCTIONS
,x_line_rec.PACKING_INSTRUCTIONS
,x_line_rec.START_DATE_ACTIVE
,x_line_rec.END_DATE_ACTIVE
,x_line_rec.MAX_RELEASE_AMOUNT
,x_line_rec.MIN_RELEASE_AMOUNT
,x_line_rec.BLANKET_MAX_AMOUNT
,x_line_rec.BLANKET_MIN_AMOUNT
,x_line_rec.BLANKET_MAX_QUANTITY
,x_line_rec.BLANKET_MIN_QUANTITY
,x_line_rec.OVERRIDE_BLANKET_CONTROLS_FLAG
,x_line_rec.OVERRIDE_RELEASE_CONTROLS_FLAG
,x_line_rec.ENFORCE_PRICE_LIST_FLAG
,x_line_rec.enforce_ship_to_flag
,x_line_rec.enforce_invoice_to_flag
,x_line_rec.enforce_freight_term_flag
,x_line_rec.enforce_shipping_method_flag
,x_line_rec.enforce_payment_term_flag
,x_line_rec.enforce_accounting_rule_flag
,x_line_rec.enforce_invoicing_rule_flag
,x_line_rec.ORDER_QUANTITY_UOM
,x_line_rec.RELEASED_QUANTITY
,x_line_rec.FULFILLED_QUANTITY
,x_line_rec.RETURNED_QUANTITY
,x_line_rec.ORDER_NUMBER
,x_line_rec.RELEASED_AMOUNT
,x_line_rec.FULFILLED_AMOUNT
,x_line_rec.RETURNED_AMOUNT
,x_line_rec.TRANSACTION_PHASE_CODE
,x_line_rec.source_document_version_number
,x_line_rec.modifier_list_line_id
FROM OE_BLANKET_LINES_HIST
WHERE
line_id = p_line_id
AND header_id = p_header_id
AND version_number = p_version
AND sales_document_type_code = 'B'
AND (PHASE_CHANGE_FLAG = p_phase_change_flag
OR (nvl(p_phase_change_flag, 'NULL') <> 'Y'
AND VERSION_FLAG = 'Y'));
SELECT ACCOUNTING_RULE_ID
, AGREEMENT_ID
, ATTRIBUTE1
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, CONTEXT
, CREATED_BY
, CREATION_DATE
, CUST_PO_NUMBER
, DELIVER_TO_ORG_ID
, FREIGHT_TERMS_CODE
, header_id
, min_release_quantity
, max_release_quantity
, inventory_item_id
, INVOICE_TO_ORG_ID
, INVOICING_RULE_ID
, ORDERED_ITEM_ID
, item_identifier_type
, ORDERED_ITEM
, ITEM_TYPE_CODE
, LAST_UPDATED_BY
, LAST_UPDATE_DATE
, LAST_UPDATE_LOGIN
, bl.line_id
, bl.line_number
, PAYMENT_TERM_ID
, PREFERRED_GRADE
, PRICE_LIST_ID
, PROGRAM_APPLICATION_ID
, PROGRAM_ID
, PROGRAM_UPDATE_DATE
, REQUEST_ID
, SALESREP_ID
, SHIPPING_METHOD_CODE
, ship_from_org_id
, SHIP_TO_ORG_ID
, SHIPPING_INSTRUCTIONS
, PACKING_INSTRUCTIONS
, START_DATE_ACTIVE
, END_DATE_ACTIVE
, MAX_RELEASE_AMOUNT
, MIN_RELEASE_AMOUNT
, BLANKET_LINE_MAX_AMOUNT
, BLANKET_LINE_MIN_AMOUNT
, BLANKET_MAX_QUANTITY
, BLANKET_MIN_QUANTITY
, OVERRIDE_BLANKET_CONTROLS_FLAG
, OVERRIDE_RELEASE_CONTROLS_FLAG
, ENFORCE_PRICE_LIST_FLAG
, enforce_ship_to_flag
, enforce_invoice_to_flag
, enforce_freight_term_flag
, enforce_shipping_method_flag
, enforce_payment_term_flag
, enforce_accounting_rule_flag
, enforce_invoicing_rule_flag
, ORDER_QUANTITY_UOM
, RELEASED_QUANTITY
, blx.FULFILLED_QUANTITY
, RETURNED_QUANTITY
, ORDER_NUMBER
, RELEASED_AMOUNT
, FULFILLED_AMOUNT
, RETURNED_AMOUNT
, TRANSACTION_PHASE_CODE
, source_document_version_number
, modifier_list_line_id
INTO
x_line_rec.ACCOUNTING_RULE_ID
,x_line_rec.AGREEMENT_ID
,x_line_rec.ATTRIBUTE1
,x_line_rec.ATTRIBUTE10
,x_line_rec.ATTRIBUTE11
,x_line_rec.ATTRIBUTE12
,x_line_rec.ATTRIBUTE13
,x_line_rec.ATTRIBUTE14
,x_line_rec.ATTRIBUTE15
,x_line_rec.ATTRIBUTE2
,x_line_rec.ATTRIBUTE3
,x_line_rec.ATTRIBUTE4
,x_line_rec.ATTRIBUTE5
,x_line_rec.ATTRIBUTE6
,x_line_rec.ATTRIBUTE7
,x_line_rec.ATTRIBUTE8
,x_line_rec.ATTRIBUTE9
,x_line_rec.CONTEXT
,x_line_rec.CREATED_BY
,x_line_rec.CREATION_DATE
,x_line_rec.CUST_PO_NUMBER
,x_line_rec.DELIVER_TO_ORG_ID
,x_line_rec.FREIGHT_TERMS_CODE
,x_line_rec.header_id
,x_line_rec.min_release_quantity
,x_line_rec.max_release_quantity
,x_line_rec.inventory_item_id
,x_line_rec.INVOICE_TO_ORG_ID
,x_line_rec.INVOICING_RULE_ID
,x_line_rec.ORDERED_ITEM_ID
,x_line_rec.item_identifier_type
,x_line_rec.ORDERED_ITEM
,x_line_rec.ITEM_TYPE_CODE
,x_line_rec.LAST_UPDATED_BY
,x_line_rec.LAST_UPDATE_DATE
,x_line_rec.LAST_UPDATE_LOGIN
,x_line_rec.line_id
,x_line_rec.line_number
,x_line_rec.PAYMENT_TERM_ID
,x_line_rec.PREFERRED_GRADE
,x_line_rec.PRICE_LIST_ID
,x_line_rec.PROGRAM_APPLICATION_ID
,x_line_rec.PROGRAM_ID
,x_line_rec.PROGRAM_UPDATE_DATE
,x_line_rec.REQUEST_ID
,x_line_rec.SALESREP_ID
,x_line_rec.SHIPPING_METHOD_CODE
,x_line_rec.ship_from_org_id
,x_line_rec.SHIP_TO_ORG_ID
,x_line_rec.SHIPPING_INSTRUCTIONS
,x_line_rec.PACKING_INSTRUCTIONS
,x_line_rec.START_DATE_ACTIVE
,x_line_rec.END_DATE_ACTIVE
,x_line_rec.MAX_RELEASE_AMOUNT
,x_line_rec.MIN_RELEASE_AMOUNT
,x_line_rec.BLANKET_MAX_AMOUNT
,x_line_rec.BLANKET_MIN_AMOUNT
,x_line_rec.BLANKET_MAX_QUANTITY
,x_line_rec.BLANKET_MIN_QUANTITY
,x_line_rec.OVERRIDE_BLANKET_CONTROLS_FLAG
,x_line_rec.OVERRIDE_RELEASE_CONTROLS_FLAG
,x_line_rec.ENFORCE_PRICE_LIST_FLAG
,x_line_rec.enforce_ship_to_flag
,x_line_rec.enforce_invoice_to_flag
,x_line_rec.enforce_freight_term_flag
,x_line_rec.enforce_shipping_method_flag
,x_line_rec.enforce_payment_term_flag
,x_line_rec.enforce_accounting_rule_flag
,x_line_rec.enforce_invoicing_rule_flag
,x_line_rec.ORDER_QUANTITY_UOM
,x_line_rec.RELEASED_QUANTITY
,x_line_rec.FULFILLED_QUANTITY
,x_line_rec.RETURNED_QUANTITY
,x_line_rec.ORDER_NUMBER
,x_line_rec.RELEASED_AMOUNT
,x_line_rec.FULFILLED_AMOUNT
,x_line_rec.RETURNED_AMOUNT
,x_line_rec.TRANSACTION_PHASE_CODE
,x_line_rec.source_document_version_number
,x_line_rec.modifier_list_line_id
FROM OE_BLANKET_LINES bl , OE_BLANKET_LINES_EXT blx
WHERE
bl.line_id = p_line_id
AND header_id = p_header_id
AND bl.line_id = blx.line_id
AND bl.sales_document_type_code = 'B';
oe_debug_pub.add(' before finding deleted lines');
x_line_changed_attr_tbl(ind).current_value := 'DELETE';
x_line_changed_attr_tbl(ind).next_value := 'DELETE';
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_current_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_prior_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_prior_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_current_deliver_to_address from dual;
select
DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
into x_next_deliver_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_current_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_prior_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_prior_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_current_invoice_to_address from dual;
select
DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
into x_next_invoice_to_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_ship_from_address from dual;
select
DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
into x_ship_from_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_current_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_prior_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_prior_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_current_ship_to_address from dual;
select
DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
into x_next_ship_to_address from dual;
SELECT distinct line_id,line_number
from oe_blanket_lines_hist
where header_id = p_header_id
--and transaction_phase_code = p_transaction_phase_code
and version_number in (p_prior_version,p_current_version,p_next_version)
union
SELECT line_id,line_number
from oe_blanket_lines_all
where header_id=p_header_id;
SELECT distinct line_id,line_number
from oe_blanket_lines_hist
where header_id = p_header_id
-- and transaction_phase_code = p_transaction_phase_code
and version_number in (p_prior_version,p_current_version,p_next_version);
SELECT MEANING
INTO l_line_status
FROM OE_LOOKUPS
WHERE LOOKUP_CODE = p_line_status_code
AND LOOKUP_TYPE = 'VERSION_COMP_LINE_STATUS';
CURSOR c1 IS select form_left_prompt from fnd_descr_flex_col_usage_vl
where application_id=660
and descriptive_flexfield_name= p_descriptive_flexfield_name
and application_column_name =p_application_column_name
and DESCRIPTIVE_FLEX_CONTEXT_CODE in (p_descriptive_flex_context_cod, p_desc_flex_context_cod_prior, p_desc_flex_context_cod_next, 'Global Data Elements');
select FORM_CONTEXT_PROMPT into l_prompt from FND_DESCRIPTIVE_FLEXS_VL
where APPLICATION_ID = p_application_id
and DESCRIPTIVE_FLEXFIELD_NAME = p_descriptive_flexfield_name;
select form_left_prompt into l_prompt from fnd_descr_flex_col_usage_vl where application_id=660
and descriptive_flexfield_name= p_descriptive_flexfield_name
and application_column_name =p_application_column_name;