The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT status FROM HZ_PARTIES
WHERE party_id = p_party_id;
SELECT status FROM HZ_ORG_CONTACTS
WHERE org_contact_id = p_contact_id;
SELECT status -- start_date_active, end_date_active obsolete
FROM HZ_PARTY_SITES
WHERE party_site_id = p_party_site_id;
SELECT start_date_active, end_date_active FROM ASO_I_ORDER_TYPES_V
WHERE order_type_id = p_order_type_id;
SELECT start_date_active, end_date_active FROM ASO_I_LINE_TYPES_V
WHERE line_type_id = p_order_line_type_id;
SELECT (start_date_active), (end_date_active) FROM QP_PRICELISTS_LOV_V
WHERE price_list_id = p_price_list_id and (orig_org_id = mo_global.get_current_org_id or global_flag ='Y'); --bug5188699
select qlhv.start_date_active, qlhv.end_date_active
from qp_list_headers_vl qlhv, oe_agreements oa
where oa.price_list_id = qlhv.list_header_id
and qlhv.list_type_code = 'PRL'
and oa.price_list_id = p_price_list_id;
SELECT start_date_active, end_date_active FROM QP_PRICE_LISTS_V
WHERE price_list_id = p_price_list_id;
select qlhv.start_date_active, qlhv.end_date_active
from qp_list_headers_vl qlhv, oe_agreements oa
where oa.price_list_id = qlhv.list_header_id
and qlhv.list_type_code = 'PRL'
and oa.price_list_id = p_price_list_id;
SELECT quote_status_id, enabled_flag
FROM ASO_QUOTE_STATUSES_B
WHERE quote_status_id = p_quote_status_id;
SELECT start_date_active, end_date_active,vendor_warranty_flag,service_item_flag FROM MTL_SYSTEM_ITEMS_B
WHERE inventory_item_id = p_inventory_item_id
and organization_id = p_organization_id;
SELECT lookup_code
FROM aso_lookups lk
WHERE lookup_type = 'ASO_ITEM_TYPE'
AND lookup_code = p_item_type_code;
/* select item_type_code from aso_i_item_types_v
where item_type_code = p_item_type_code; */
select source_code_id from aso_i_mktg_src_codes_v
where source_code_id = p_mkting_source_code_id;
select uom_code from MTL_ITEM_UOMS_VIEW
where uom_code = p_uom_code
and inventory_item_id = p_inventory_item_id
and organization_id = p_organization_id;
SELECT component_code
FROM cz_config_details_V
WHERE CONFIG_HDR_ID = p_config_header_id
AND CONFIG_REV_NBR = p_config_revision_num
--AND component_code = p_component_code;
select service_reference_type_code
from aso_i_service_types_v
where service_reference_type_code = p_service_ref_type_code;*/
select lookup_code
from aso_lookups
where lookup_code = p_service_ref_type_code and
lookup_type = 'ASO_SERVICE_TYPE';
SELECT inventory_item_id, service_item_flag
FROM mtl_system_items_b
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id;
select return_reference_type_code
from aso_i_return_types_v
where return_reference_type_code = p_return_ref_type_code;
SELECT start_date_active, end_date_active,status
FROM jtf_rs_srp_vl
WHERE person_id = p_employee_id;
select name from oe_sales_credit_types
where sales_credit_type_id = p_salescredit_type_id;
select 'VALID'
from aso_lookups
where lookup_type = 'ASO_PARTY_TYPE'
and lookup_code = p_party_type;
select 'VALID'
/* from jtf_rs_srp_vl */ --Commented Code Yogeshwar (MOAC)
from jtf_rs_salesreps_mo_v --New Code Yogeshwar (MOAC)
WHERE trunc(sysdate) BETWEEN trunc(NVL(start_date_active, sysdate))
AND trunc(NVL(end_date_active, sysdate))
--Commentd Code Start Yogeshwar (MOAC)
/*
AND NVL(ORG_ID,NVL(TO_NUMBER(DECODE(SUBSTRB(USERENV('CLIENT_INFO' ),1,1) , ' ', NULL, SUBSTRB(USERENV('CLIENT_INFO'),1,10))),-99)) = NVL(TO_NUMBER(DECODE(SUBSTRB(USERENV('CLIENT_INFO'),1,1), ' ', NULL,SUBSTRB(USERENV('CLIENT_INFO'),1,10))),-99)
*/
--Commented Code End Yogeshwar (MOAC)
AND resource_id = l_resource_id;
select person_id
from jtf_rs_srp_vl
where resource_id = p_resource_id
and trunc(sysdate) BETWEEN trunc(NVL(start_date_active, sysdate)) AND
trunc(NVL(end_date_active, sysdate));
select 'VALID'
from jtf_rs_groups_b
where group_id = p_resource_group_id
and trunc(sysdate) BETWEEN trunc(NVL(start_date_active, sysdate)) AND
trunc(NVL(end_date_active, sysdate));
select 'VALID'
from aso_lookups
where lookup_type = 'ASO_PARTY_OBJECT_TYPE'
and lookup_code = p_party_object_type;
select contact_point_type
from aso_i_contact_points_v
where contact_point_id = p_party_object_id;
select quote_version
from aso_quote_headers_all
where quote_number = p_quote_number;
SELECT 'Y'
FROM fnd_descriptive_flexs
WHERE application_id = ASO_QUOTE_PUB.OC_APPL_ID
and descriptive_flexfield_name = p_desc_flex_name;
SELECT status, account_activation_date, account_termination_date
FROM HZ_CUST_ACCOUNTS
WHERE cust_account_id = l_account_id;
SELECT subject_id, a.status
FROM HZ_ORG_CONTACTS a, HZ_RELATIONSHIPS b
WHERE org_contact_id = l_contact_id
AND a.party_relationship_id = b.relationship_id;
SELECT status, party_type
FROM HZ_PARTIES
WHERE party_id= l_party_id;
SELECT status FROM HZ_PARTIES
WHERE party_id = l_pty_id and party_type in
('PERSON','PARTY_RELATIONSHIP','ORGANIZATION');
SELECT status FROM HZ_PARTIES
WHERE party_id = l_pty_id AND party_type ='PARTY_RELATIONSHIP';
SELECT a.status
FROM HZ_PARTY_SITES a
WHERE a.party_site_id = l_pty_site;
SELECT a.status FROM HZ_CUST_ACCOUNTS a
WHERE a.party_id = p_cust_party_id AND cust_account_id = p_cust_account_id;
SELECT begin_date, end_date FROM HZ_CUST_ACCOUNT_ROLES
WHERE party_id = p_party_id AND cust_account_id = p_cust_account_id
AND role_type ='ACCOUNT_USER';
SELECT party_type FROM HZ_PARTIES
WHERE party_id= l_pty_id;
SELECT 'x' FROM
HZ_RELATIONSHIPS a, HZ_ORG_CONTACTS b
WHERE a.relationship_id = b.party_relationship_id
AND a.object_id = p_cust_party_id;
SELECT 'x' FROM
HZ_RELATIONSHIPS a, HZ_ORG_CONTACTS b,
HZ_CUST_ACCOUNTS c
WHERE a.relationship_id= b.party_relationship_id
AND c.cust_Account_id = p_cust_account_id
AND a.object_id = c.party_id;
SELECT 'X'
FROM HZ_RELATIONSHIPS
WHERE party_id = l_party
AND subject_type = 'PERSON'
AND object_type = 'PERSON';
SELECT 'x' FROM
HZ_RELATIONSHIPS a, hz_org_contacts b
WHERE
a.party_id = p_inv_party_id
AND a.object_id = lc_party_id
AND b.party_relationship_id = a.relationship_id
AND exists (select 'y' from HZ_PARTIES d
where d.party_type ='PERSON' and
d.party_id= a.subject_id);
select party_id from
hz_cust_accounts
where
cust_account_id = l_cust_acct_id;
select party_type
from hz_parties
where party_id = p_party_id;
select object_id
from
hz_relationships
where party_id = p_party_id
and subject_type ='PERSON'
and subject_table_name = 'HZ_PARTIES'
and object_type = 'ORGANIZATION'
and object_table_name = 'HZ_PARTIES';
SELECT 'X'
FROM HZ_RELATIONSHIPS
WHERE party_id = l_party
AND subject_type = 'PERSON'
AND object_type = 'PERSON';
SELECT b.party_id,a.party_type FROM HZ_PARTIES a,HZ_PARTY_SITES b
WHERE a.party_id = b.party_id
AND b.party_site_id = l_party_site_id;
select party_id from
hz_cust_accounts
where
cust_account_id = l_cust_acct_id;
select party_type
from hz_parties
where party_id = p_party_id;
select object_id
from
hz_relationships
where party_id = px_party_id
and subject_type ='PERSON'
and subject_table_name = 'HZ_PARTIES'
and object_type = 'ORGANIZATION'
and object_table_name = 'HZ_PARTIES';
SELECT object_id ,a.status FROM HZ_ORG_CONTACTS a,
HZ_RELATIONSHIPS b
WHERE org_contact_id = p_contact_id
and a.party_relationship_id = b.relationship_id;
SELECT status from HZ_PARTIES a
WHERE a.party_id=l_party_id and a.party_id=p_party_id
AND Party_type in('ORGANIZATION','PARTY_RELATIONSHIP');
SELECT status from HZ_CUST_ACCOUNTS
WHERE party_id=l_party_id and
cust_account_id = p_cust_account_id;
SELECT par.party_id
FROM hz_relationships par,
hz_org_contacts org
WHERE org.party_relationship_id = par.relationship_id
AND org.org_contact_id = l_org_contact_id
-- AND org.status = 'A' status column obseleted
and par.status = 'A'
and (sysdate between nvl(par.start_date, sysdate) and nvl(par.end_date, sysdate));
IF (p_application_type_code = 'QUOTING HTML' AND p_operation_code = 'UPDATE') THEN
l_qte_header_rec := ASO_UTILITY_PVT.query_header_row (lp_qte_header_rec.quote_header_id);
IF lp_shipment_rec.operation_code = 'UPDATE' THEN
IF lp_shipment_rec.shipment_id IS NOT NULL AND lp_shipment_rec.shipment_id <> FND_API.G_MISS_NUM THEN
l_shipment_rec := ASO_UTILITY_PVT.query_shipment_row (lp_shipment_rec.shipment_id);
END IF; -- UPDATE
SELECT par.party_id
FROM hz_relationships par,
hz_org_contacts org
WHERE org.party_relationship_id = par.relationship_id
AND org.org_contact_id = l_org_contact_id
-- AND org.status = 'A' -- status column obseleted
and par.status = 'A'
and (sysdate between nvl(par.start_date, sysdate) and nvl(par.end_date, sysdate));
IF (p_application_type_code = 'QUOTING HTML' AND p_operation_code = 'UPDATE') THEN
l_qte_header_rec := ASO_UTILITY_PVT.query_header_row (lp_qte_header_rec.quote_header_id);
IF lp_shipment_rec.operation_code = 'UPDATE' THEN
IF lp_shipment_rec.shipment_id IS NOT NULL AND lp_shipment_rec.shipment_id <> FND_API.G_MISS_NUM THEN
l_shipment_rec := ASO_UTILITY_PVT.query_shipment_row (lp_shipment_rec.shipment_id);
END IF; -- UPDATE
CURSOR C1 IS select 'x'
from aso_lookups
where lookup_type = 'ASO_QUOTE_OBJECT_TYPE'
and lookup_code = p_QUOTE_OBJECT_TYPE_CODE;
CURSOR C1 IS select 'x'
from aso_lookups
where lookup_type = 'ASO_RELATED_OBJECT_TYPE'
and lookup_code = p_OBJECT_TYPE_CODE;
CURSOR C1 IS SELECT 'x'
from aso_lookups
where lookup_type = 'ASO_OBJECT_RELATIONSHIP_TYPE'
and lookup_code = p_RELATIONSHIP_TYPE_CODE;
SELECT start_date_active, end_date_active FROM IBE_MSITES_B
WHERE msite_id = p_minisite_id;
SELECT start_date_active, end_date_active FROM IBE_DSP_SECTIONS_B
WHERE section_id = p_section_id;
SELECT SUM(A.percent) total
FROM ASO_SALES_CREDITS A,
OE_SALES_CREDIT_TYPES B
WHERE A.quote_header_id = l_quote_header_id
AND A.quote_line_id IS NULL
AND A.sales_credit_type_id = B.sales_credit_type_id
AND B.quota_flag = 'Y';
SELECT SUM(A.percent) total
FROM ASO_SALES_CREDITS A,
OE_SALES_CREDIT_TYPES B
WHERE A.quote_header_id = l_quote_header_id
AND A.quote_line_id = l_quote_line_id
AND A.sales_credit_type_id = B.sales_credit_type_id
AND B.quota_flag = 'Y';
SELECT org.organization_id
FROM mtl_system_items msi, hr_organization_units org
WHERE msi.inventory_item_id = p_qte_line_rec.inventory_item_id
AND org.organization_id= msi.organization_id
AND sysdate <= nvl( org.date_to, sysdate)
AND org.organization_id= p_shipment_rec.ship_from_org_id
--AND msi.organization_id= p_qte_line_rec.organization_id
AND rownum = 1 ;
SELECT 'VALID'
FROM ra_customer_trx ratrx, ra_customer_trx_lines ratrl
WHERE EXISTS
(SELECT 1 FROM ra_cust_trx_types ractt
WHERE ractt.type IN ('DEP', 'GUAR')
AND ratrx.cust_trx_type_id = ractt.cust_trx_type_id
AND ractt.org_id = l_org_id)
AND ratrx.bill_to_customer_id = l_cust_account_id
AND ratrx.complete_flag = 'Y'
AND trunc(sysdate) BETWEEN trunc(nvl(ratrx.start_date_commitment, sysdate))
AND trunc(nvl(ratrx.end_date_commitment, sysdate))
AND ratrx.invoice_currency_code = l_currency_code
AND nvl(l_agreement_id, nvl(ratrx.agreement_id,0)) = nvl(ratrx.agreement_id, nvl(l_agreement_id,0))
AND ratrl.customer_trx_id = ratrx.customer_trx_id
AND nvl(ratrl.inventory_item_id, nvl(l_inventory_item_id,0)) = nvl(l_inventory_item_id,0)
AND ratrx.customer_trx_id = l_commitment_id;
SELECT Contract_Id
FROM ASO_QUOTE_HEADERS_ALL
WHERE Quote_Header_Id = l_qte_hdr_id;
SELECT Org_Id, Currency_Code, Invoice_To_Cust_Account_Id
FROM ASO_QUOTE_HEADERS_ALL
WHERE Quote_Header_Id = l_qte_hdr_id;
SELECT Agreement_Id, Commitment_Id, Inventory_Item_Id
FROM ASO_QUOTE_LINES_ALL
WHERE Quote_Line_Id = l_qte_ln_id;
ELSE -- Operation is 'UPDATE'
OPEN C_Header_Cur(P_Qte_Header_Rec.Quote_Header_Id);
SELECT Start_Date_Active, End_Date_Active
FROM OE_AGREEMENTS_B
WHERE Agreement_Id = l_agreement_id;
SELECT transition_id, enabled_flag
FROM ASO_QUOTE_STATUS_TRANSITIONS
WHERE from_status_id = p_source_status_id
AND to_status_id = p_dest_status_id;
SELECT major_version
FROM okc_sales_templates_v
WHERE id = lc_template_id;
SELECT list_line_id
FROM qp_list_lines
WHERE list_header_id = p_list_header_id;
SELECT list_header_id
FROM qp_list_lines
WHERE list_line_id = p_list_line_id;
SELECT price_attribute_id
FROM aso_price_attributes
WHERE quote_header_id = p_quote_header_id
AND nvl(quote_line_id,0) = nvl(decode(p_quote_line_id,FND_API.G_MISS_NUM,null,p_quote_line_id),0)
AND nvl(pricing_attribute1,'X') = nvl(p_pricing_attribute1,'X')
AND nvl(pricing_attribute2,'Y') = nvl(p_pricing_attribute2,'Y');
SELECT price_attribute_id
FROM aso_price_attributes
WHERE quote_header_id = p_quote_header_id
AND nvl(quote_line_id,0) = nvl(decode(p_quote_line_id,FND_API.G_MISS_NUM,null,p_quote_line_id),0)
AND pricing_attribute1 IN ( SELECT to_char(qpe.list_header_id)
FROM qp_list_lines qpe
WHERE qpe.list_line_id = p_list_line_id);
SELECT price_attribute_id
FROM aso_price_attributes
WHERE quote_header_id = p_quote_header_id
AND nvl(quote_line_id,0) = nvl(decode(p_quote_line_id,FND_API.G_MISS_NUM,null,p_quote_line_id),0)
AND (
( nvl(pricing_attribute2,'X') = nvl(p_pricing_attribute2,'X') AND
p_pricing_attribute2 IS NOT NULL
)
OR ( p_pricing_attribute2 IS NULL
AND pricing_attribute2 IN ( SELECT to_char(qpe.list_line_id)
FROM qp_list_lines qpe
WHERE qpe.list_header_id = p_list_header_id)
)
);
AND nvl(pricing_attribute2,'Y') IN ( SELECT qpe.list_line_id
FROM qp_list_lines qpe
WHERE qpe.list_header_id = qp.list_header_id)
)
*/
BEGIN
-- Standard Start of API savepoint
SAVEPOINT VALIDATE_PROMOTION_PVT;
AND l_price_attr_tbl(j).operation_code = 'DELETE' THEN
IF ASO_DEBUG_PUB.G_Debug_Flag = 'Y' THEN
aso_debug_pub.add('Comparing with DELETE decrementing l_count',1,'N');
AND l_price_attr_tbl(j).operation_code = 'DELETE' THEN
IF ASO_DEBUG_PUB.G_Debug_Flag = 'Y' THEN
aso_debug_pub.add('Comparing with DELETE decrementing l_count',1,'N');
AND l_price_attr_tbl(j).operation_code = 'DELETE' THEN
IF ASO_DEBUG_PUB.G_Debug_Flag = 'Y' THEN
aso_debug_pub.add('Comparing with DELETE decrementing l_count',1,'N');
AND l_price_attr_tbl(j).operation_code = 'DELETE' THEN
IF ASO_DEBUG_PUB.G_Debug_Flag = 'Y' THEN
aso_debug_pub.add('Comparing with DELETE decrementing l_count',1,'N');
SELECT start_date_active, end_date_active FROM RA_TERMS_VL
WHERE term_id = p_payment_term_id;
SELECT start_date_active, end_date_active FROM OE_LOOKUPS
WHERE lookup_type = 'FREIGHT_TERMS'
AND enabled_flag = 'Y'
AND lookup_code = p_freight_terms_code;
SELECT start_date_active, end_date_active
FROM wsh_carrier_ship_methods csm,
fnd_lookup_values fl
WHERE csm.ship_method_code = p_ship_method_code
AND csm.organization_id = p_org_id
AND csm.enabled_flag = 'Y'
AND fl.lookup_type = 'SHIP_METHOD'
AND fl.lookup_code = csm.ship_method_code
AND fl.view_application_id = 3
AND fl.LANGUAGE = userenv('LANG')
AND fl.enabled_flag = 'Y';
SELECT aso.org_id
FROM ASO_QUOTE_HEADERS_ALL aso
WHERE aso.quote_header_id = p_qte_header_id;
SELECT aso.organization_id
FROM ASO_QUOTE_LINES_ALL aso
WHERE aso.quote_line_id = p_qte_line_id;
SELECT aso.org_id
FROM ASO_QUOTE_LINES_ALL aso
WHERE aso.quote_line_id = p_qte_line_id;
SELECT start_date_active, end_date_active
FROM OE_WF_LINE_ASSIGN_V
WHERE order_type_id = p_qte_header_rec.order_type_id
and line_type_id = p_qte_line_rec.order_line_type_id
and (trunc(sysdate) BETWEEN NVL(start_date_active, sysdate) AND
NVL(end_date_active, sysdate));
SELECT line_category_code from aso_quote_lines_all
where quote_line_id = p_qte_line_rec.quote_line_id;
SELECT quote_category_code from aso_quote_headers_all
where quote_header_id = p_qte_header_rec.quote_header_id;
SELECT 'x' from aso_payments
where quote_header_id = p_qte_header_rec.quote_header_id
and cust_po_line_number is not null
and cust_po_number is null;
SELECT cust_po_number from aso_payments
where quote_header_id = p_qte_header_rec.quote_header_id
and quote_line_id is null;
SELECT cust_po_number, cust_po_line_number from aso_payments
where quote_header_id = p_qte_header_rec.quote_header_id
and quote_line_id = p_qte_line_rec.quote_line_id;
select quote_line_id from aso_quote_lines_all
where quote_line_id = p_service_ref_line_id
and quote_header_id = p_qte_header_id;
select line_id from oe_order_lines_all
where line_id = p_service_ref_line_id;
select instance_id
from csi_item_instances
where instance_id = p_service_ref_line_id;
SELECT 1 FROM DUAL WHERE exists
(
SELECT meaning fob
FROM ar_lookups
WHERE lookup_type = 'FOB'
AND enabled_flag = 'Y'
AND trunc(sysdate) BETWEEN NVL(start_date_active, trunc(sysdate))
AND NVL(end_date_active, trunc(sysdate))
AND lookup_code = p_lookup_code
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT meaning shipment_priority
FROM oe_lookups
WHERE lookup_type = 'SHIPMENT_PRIORITY'
AND enabled_flag = 'Y'
AND trunc(sysdate) between nvl(start_date_active, trunc(sysdate)) and nvl(end_date_active, trunc(sysdate))
AND lookup_code = p_shipment_priority_code
);
SELECT 1 FROM DUAL WHERE exists
(
SELECT lookup_code
FROM fnd_lookup_values_vl
WHERE lookup_type = 'SALES_CHANNEL'
AND view_application_id = 660
AND enabled_flag = 'Y'
AND trunc( NVL(start_date_active, sysdate) ) <= trunc( sysdate )
AND trunc( NVL(end_date_active, sysdate) ) >= trunc( sysdate )
and lookup_code = p_lookup_code
);
SELECT 1 FROM DUAL WHERE exists
(
SELECT d.currency_code currency_code
FROM Fnd_currencies d
,qp_currency_details b
,qp_list_headers_b c
WHERE c.list_header_id = p_price_list_id
AND b.currency_header_id = c.currency_header_id
AND d.currency_code = b.to_currency_code
AND c.list_type_code IN ('PRL', 'AGR')
AND d.currency_flag = 'Y'
AND d.enabled_flag = 'Y'
AND trunc(sysdate) between trunc(nvl(d.start_date_active,sysdate)) and trunc(nvl(d.end_date_active,sysdate))
and trunc(sysdate) between trunc(nvl(c.start_date_active,sysdate)) and trunc(nvl(c.end_date_active,sysdate))
and trunc(sysdate) between trunc(nvl(b.start_date_active,sysdate)) and trunc(nvl(b.end_date_active,sysdate))
AND d.currency_code = p_currency_code
UNION
SELECT b.currency_code currency_code
FROM fnd_currencies b,qp_list_headers_b c
WHERE c.currency_code = b.currency_code
AND c.list_header_id = p_price_list_id
AND c.list_type_code IN ('PRL', 'AGR')
AND b.currency_flag = 'Y'
AND b.enabled_flag = 'Y'
and trunc(sysdate) between trunc(nvl(b.start_date_active,sysdate)) and trunc(nvl(b.end_date_active,sysdate))
AND b.currency_code = p_currency_code
);
SELECT 1 FROM DUAL WHERE exists
(
SELECT b.currency_code
FROM fnd_currencies b
WHERE b.currency_flag = 'Y'
AND b.enabled_flag = 'Y'
AND trunc(sysdate) between trunc(nvl(start_date_active,sysdate)) and trunc(nvl(end_date_active,sysdate))
and b.currency_code = p_currency_code
);
SELECT 1 FROM DUAL WHERE exists
(
SELECT Lookup_Code Payment_Type_Code
from ASO_LOOKUPS
WHERE LOOKUP_TYPE = 'ASO_PAYMENT_TYPE'
and lookup_code <> 'PO'
and trunc(nvl(start_date_active,sysdate)) <= trunc(sysdate)
and trunc(nvl(end_daTe_active,sysdate)) >= trunc (sysdate)
and enabled_flag = 'Y'
and lookup_code = p_lookup_code
);
SELECT 1 FROM DUAL WHERE exists
(
SELECT CARD_ISSUER_CODE credit_card_code
FROM IBY_CREDITCARD_ISSUERS_V
where CARD_ISSUER_CODE = p_credit_card_code
);
SELECT 1 FROM DUAL WHERE exists
(
Select lookup_code Demand_Class_Code,
meaning Demand_Class,
description
From FND_COMMON_LOOKUPS
Where lookup_type = 'DEMAND_CLASS'
And application_id = 700
And enabled_flag = 'Y'
And trunc(sysdate) Between NVL(start_date_active,trunc(sysdate))
And NVL(end_date_active,trunc(sysdate))
And lookup_code = p_lookup_code
);
SELECT 1 FROM DUAL WHERE exists
(
Select lookup_code
from oe_lookups
where lookup_type='REQUEST_DATE_TYPE'
and lookup_code = p_lookup_code
and ENABLED_FLAG = 'Y'
and trunc(sysdate) between trunc(start_date_active)
and trunc(nvl(end_date_active,sysdate))
);
SELECT 1 FROM DUAL WHERE exists
(
select 1 from dual where trunc(p_request_date) >= trunc(sysdate)
);
select DECODE(MO_GLOBAL.CHECK_ACCESS(p_org_id),'Y','Y','N',NULL,NULL) from dual ;
SELECT 1 FROM DUAL WHERE exists
(
Select distinct uom_code
From MTL_UNITS_OF_MEASURE_VL --Changed mtl_uom_conversions to MTL_UNITS_OF_MEASURE_VL 05/10/2005(Yogeshwar)
Where uom_class=p_periodicity_profile
And uom_code=p_periodicity_code
);
SELECT 1 FROM DUAL WHERE exists
(
select lookup_code
from aso_lookups
where lookup_type='ASO_PRICE_TAX_COMPUTE_OPTION'
and lookup_code = p_lookup_code
and ENABLED_FLAG = 'Y'
and trunc(sysdate) between trunc(start_date_active)
and trunc(nvl(end_date_active,sysdate))
);
SELECT 1 FROM DUAL WHERE exists
(
select lookup_code
from aso_lookups
where lookup_type='ASO_PRICE_TAX_COMPUTE_OPTION'
and lookup_code = p_lookup_code
and ENABLED_FLAG = 'Y'
and trunc(sysdate) between trunc(start_date_active)
and trunc(nvl(end_date_active,sysdate))
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT phone.contact_point_id
FROM HZ_CONTACT_POINTS phone,
HZ_PARTIES hp
WHERE HP.party_id = p_party_id --When contact is specified
AND phone.owner_table_id = hp.party_id
AND hp.status = 'A'
AND phone.status = 'A'
AND phone.owner_table_name = 'HZ_PARTIES'
AND phone.contact_point_type = 'PHONE'
AND phone.contact_point_id = p_phone_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT phone.contact_point_id
FROM HZ_CONTACT_POINTS phone,
HZ_PARTIES hp
WHERE HP.party_id = p_cust_party_id
AND phone.owner_table_id = hp.party_id
AND hp.status = 'A'
AND phone.status = 'A'
AND phone.owner_table_name = 'HZ_PARTIES'
AND phone.contact_point_type = 'PHONE'
AND phone.contact_point_id = p_phone_id
);
SELECT PARTY_TYPE --Selecting the party type from HZ_PARTIES
INTO l_cust_party_type
FROM HZ_PARTIES
WHERE PARTY_ID = nvl(p_party_id,p_cust_party_id);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT hp.party_name --(Base Query)
FROM HZ_PARTIES HP
WHERE hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND HP.PARTY_ID = p_cust_party_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
select null
from HZ_PARTIES P
where P.status = 'A'
AND p.party_type in ('PERSON','ORGANIZATION')
AND P.party_id = p_cust_party_id
AND EXISTS ( SELECT null
FROM as_accesses_all_all secu
WHERE secu.customer_id = P.party_id
and secu.delete_flag is null
and secu.sales_group_id in (
SELECT jrgd.group_id
FROM jtf_rs_groups_denorm jrgd,
jtf_rs_group_usages jrgu
WHERE jrgd.parent_group_id IN (
select u.group_id
from jtf_rs_rep_managers mgr,
jtf_rs_group_usages u
where mgr.parent_resource_id = p_resource_id
and trunc(sysdate) between trunc(mgr.start_date_active)
and trunc(nvl(mgr.end_date_active,sysdate))
and mgr.hierarchy_type = 'MGR_TO_REP'
and mgr.group_id = u.group_id
and u.usage in ('SALES','PRM')
)
AND trunc(jrgd.start_date_active) <= TRUNC(SYSDATE)
AND trunc(NVL(jrgd.end_date_active, SYSDATE)) >= TRUNC(SYSDATE)
AND jrgu.group_id = jrgd.group_id
AND jrgu.usage in ('SALES', 'PRM'))
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL )
UNION ALL
SELECT null
FROM as_accesses_all_all secu,
HZ_PARTIES P
WHERE secu.customer_id = P.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND secu.delete_flag is NULL
AND salesforce_id = p_resource_id
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
select P.party_name
from HZ_PARTIES P
where P.status = 'A'
AND P.party_id = p_cust_party_id
AND p.party_type in ('PERSON','ORGANIZATION')
AND (exists (SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = p.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL AND salesforce_id = p_resource_id
)
)
);
select 1 from dual where exists
(
SELECT MGR.group_id
FROM jtf_rs_rep_managers MGR ,
jtf_rs_group_usages U
WHERE U.usage = 'SALES'
AND U.group_id = MGR.group_id
AND trunc(MGR.start_date_active) <= trunc(SYSDATE)
AND trunc(NVL(MGR.end_date_active, SYSDATE)) >= trunc(SYSDATE)
AND MGR.parent_resource_id = MGR.resource_id
AND MGR.hierarchy_type in ('MGR_TO_MGR', 'MGR_TO_REP')
AND MGR.parent_resource_id = p_resource_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT hp_contact.party_name
FROM HZ_PARTIES hp_contact,
HZ_RELATIONSHIPS hp_rltn
WHERE hp_rltn.object_id = p_cust_party_id --lv_cust_party_id
AND hp_rltn.party_id = p_party_id
AND hp_contact.party_id = hp_rltn.subject_id
AND hp_contact.party_type = 'PERSON'
AND hp_rltn.relationship_code IN ( Select distinct reltype.forward_rel_code
From HZ_RELATIONSHIP_TYPES reltype, HZ_CODE_ASSIGNMENTS code
Where code.class_category = 'RELATIONSHIP_TYPE_GROUP'
and code.class_code = 'PARTY_REL_GRP_CONTACTS'
and code.owner_table_name = 'HZ_RELATIONSHIP_TYPES'
and code.owner_table_id = reltype.relationship_type_id
and code.status = 'A'
and trunc(code.start_date_active) <= trunc(sysdate)
and trunc(nvl(code.end_date_active,sysdate)) >= trunc(sysdate)
and reltype.subject_type = 'PERSON'
and reltype.object_type = 'ORGANIZATION'
)
AND hp_contact.status = 'A'
AND hp_rltn.status = 'A'
AND trunc(hp_rltn.start_date) <= trunc(sysdate)
AND trunc(nvl(hp_rltn.end_date,sysdate)) >= trunc(sysdate)
);
select 1 from DUAL where exists
(
SELECT MGR.group_id
FROM jtf_rs_rep_managers MGR ,
jtf_rs_group_usages U
WHERE U.usage = 'SALES'
AND U.group_id = MGR.group_id
AND TRUNC(MGR.start_date_active) <= trunc(SYSDATE)
AND TRUNC(NVL(MGR.end_date_active, SYSDATE) )>= trunc(SYSDATE)
AND MGR.parent_resource_id = MGR.resource_id
AND MGR.hierarchy_type in ('MGR_TO_MGR', 'MGR_TO_REP')
AND MGR.parent_resource_id = p_resource_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT hp.party_id --Removed HZ_CUST_ACCOUNTS ca
FROM HZ_PARTIES hp
WHERE hp.party_type in ('PERSON','ORGANIZATION')
AND hp.party_id = p_cust_party_id
AND hp.status = 'A'
UNION
SELECT hp.party_id
FROM HZ_PARTIES hp,
HZ_CUST_ACCT_RELATE car
WHERE car.related_cust_account_id = p_cust_acct_id
AND car.relationship_type = 'ALL'
AND car.bill_to_flag = 'Y'
AND hp.party_id = p_cust_party_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND car.status = 'A'
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT hp.party_id
FROM HZ_PARTIES hp
WHERE hp.party_id = p_cust_party_id
AND hp.status = 'A'
AND hp.party_type in ('PERSON','ORGANIZATION')
UNION
SELECT hp.party_id
FROM HZ_PARTIES hp,
HZ_CUST_ACCT_RELATE car
WHERE car.related_cust_account_id = p_cust_acct_id
AND car.relationship_type = 'ALL'
AND car.ship_to_flag = 'Y'
AND hp.party_id = p_cust_party_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND car.status = 'A'
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT hp.party_id
FROM HZ_PARTIES hp
WHERE hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND hp.party_id = p_cust_party_id --:QOTHDDET_MAIN.sold_to_cust_party_id
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
select P.party_id
from HZ_PARTIES P
where P.status = 'A'
AND P.party_id = p_cust_party_id
AND EXISTS ( SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = P.party_id
AND secu.sales_group_id in (
SELECT jrgd.group_id
FROM jtf_rs_groups_denorm jrgd,
jtf_rs_group_usages jrgu
WHERE jrgd.parent_group_id IN (
select u.group_id
from jtf_rs_rep_managers mgr,
jtf_rs_group_usages u
where mgr.parent_resource_id = p_resource_id
and trunc(sysdate) between trunc(mgr.start_date_active)
and trunc(nvl(mgr.end_date_active,sysdate))
and mgr.hierarchy_type = 'MGR_TO_REP'
and mgr.group_id = u.group_id
and u.usage in ('SALES','PRM')
)
AND TRUNC(jrgd.start_date_active) <= TRUNC(SYSDATE)
AND TRUNC(NVL(jrgd.end_date_active, SYSDATE) )>= TRUNC(SYSDATE)
AND jrgu.group_id = jrgd.group_id
AND jrgu.usage in ('SALES', 'PRM'))
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
UNION ALL
SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = p.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND salesforce_id = p_resource_id
)
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
select P.status
from HZ_PARTIES P
where P.status = 'A'
AND P.party_id = p_cust_party_id
AND (exists (SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = p.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND salesforce_id = p_resource_id
)
)
);
select 1 from dual where exists
(
SELECT MGR.group_id
FROM jtf_rs_rep_managers MGR ,
jtf_rs_group_usages U
WHERE U.usage = 'SALES'
AND U.group_id = MGR.group_id
AND trunc(MGR.start_date_active) <= trunc(SYSDATE)
AND trunc(NVL(MGR.end_date_active, SYSDATE)) >= trunc(SYSDATE)
AND MGR.parent_resource_id = MGR.resource_id
AND MGR.hierarchy_type in ('MGR_TO_MGR', 'MGR_TO_REP')
AND MGR.parent_resource_id = p_resource_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT ca.account_number
FROM HZ_PARTIES hp,
HZ_CUST_ACCOUNTS ca,
HZ_CUST_ACCT_RELATE car
WHERE hp.party_id = ca.party_id
AND car.related_cust_account_id = p_sold_to_cust_acct_id
AND car.cust_account_id = ca.cust_account_id
AND car.relationship_type = 'ALL'
AND car.ship_to_flag = 'Y'
AND hp.party_id = p_cust_party_id
AND ca.cust_account_id = p_cust_acct_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND ca.status = 'A'
AND trunc(nvl(ca.account_activation_date,sysdate)) <= trunc(sysdate)
AND trunc(nvl(ca.account_termination_date,sysdate)) >= trunc(sysdate)
AND car.status = 'A'
UNION
SELECT ca.account_number
FROM HZ_PARTIES hp,
HZ_CUST_ACCOUNTS ca
WHERE hp.party_id = ca.party_id
AND ca.cust_account_id = p_sold_to_cust_acct_id
AND hp.party_id = p_cust_party_id
AND ca.cust_account_id = p_cust_acct_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND ca.status = 'A'
AND trunc(nvl(ca.account_activation_date,sysdate)) <= trunc(sysdate)
AND trunc(nvl(ca.account_termination_date,sysdate)) >= trunc(sysdate)
);
SELECT ca.account_number
FROM HZ_PARTIES hp,
HZ_CUST_ACCOUNTS ca,
HZ_CUST_ACCT_RELATE car
WHERE hp.party_id = ca.party_id
AND car.related_cust_account_id = p_sold_to_cust_acct_id
AND car.status = 'A'
AND ca.cust_account_id = car.cust_account_id
AND car.relationship_type = 'ALL'
AND car.ship_to_flag = 'Y'
AND hp.party_id = p_cust_party_id
AND ca.cust_account_id = p_cust_acct_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND ca.status = 'A'
UNION
SELECT ca.account_number
FROM HZ_PARTIES hp,
HZ_CUST_ACCOUNTS ca
WHERE hp.party_id = ca.party_id
AND ca.cust_account_id = p_sold_to_cust_acct_id
AND hp.party_id = p_cust_party_id
AND ca.cust_account_id = p_cust_acct_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND ca.status = 'A'
AND trunc(nvl(ca.account_activation_date,sysdate)) <= trunc(sysdate)
AND trunc(nvl(ca.account_termination_date,sysdate)) >= trunc(sysdate) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT ca.account_number
FROM HZ_PARTIES hp,
HZ_CUST_ACCOUNTS ca
WHERE hp.party_id = ca.party_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND hp.status = 'A'
AND ca.status = 'A'
AND hp.party_id = p_cust_party_id
AND CA.CUST_ACCOUNT_ID = p_cust_acct_id
AND trunc(nvl(ca.account_activation_date,sysdate)) <= trunc(sysdate)
AND trunc(nvl(ca.account_termination_date,sysdate)) >= trunc(sysdate)
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
select null
from HZ_PARTIES P
,HZ_CUST_ACCOUNTS CA
where CA.status = 'A'
AND p.party_type in ('PERSON','ORGANIZATION')
AND P.party_id = p_cust_party_id
AND P.status = 'A'
AND P.party_id = CA.party_id
AND CA.CUST_ACCOUNT_ID = p_cust_acct_id
AND EXISTS ( SELECT null
FROM as_accesses_all_all secu
WHERE secu.customer_id = P.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND secu.delete_flag is NULL
and secu.sales_group_id in (
SELECT jrgd.group_id
FROM jtf_rs_groups_denorm jrgd,
jtf_rs_group_usages jrgu
WHERE jrgd.parent_group_id IN (
select u.group_id
from jtf_rs_rep_managers mgr,
jtf_rs_group_usages u
where mgr.parent_resource_id = p_resource_id
and trunc(sysdate) between trunc(mgr.start_date_active)
and trunc(nvl(mgr.end_date_active,sysdate))
and mgr.hierarchy_type = 'MGR_TO_REP'
and mgr.group_id = u.group_id
and u.usage in ('SALES','PRM')
)
AND trunc(jrgd.start_date_active) <= TRUNC(SYSDATE)
AND trunc(NVL(jrgd.end_date_active, SYSDATE)) >= TRUNC(SYSDATE)
AND jrgu.group_id = jrgd.group_id
AND jrgu.usage in ('SALES', 'PRM')))
UNION ALL
SELECT null
FROM as_accesses_all_all secu,
HZ_PARTIES P
WHERE secu.customer_id = P.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND secu.delete_flag is NULL
AND salesforce_id = p_resource_id
) ;
SELECT 1 FROM DUAL WHERE EXISTS
(
select CA.account_number
from HZ_PARTIES HP ,
HZ_CUST_ACCOUNTS CA
where CA.status = 'A'
AND trunc(nvl(CA.account_activation_date, SYSDATE)) <= trunc(SYSDATE)
AND trunc(nvl(CA.account_termination_date, SYSDATE)) >= trunc(SYSDATE)
AND HP.status = 'A'
AND HP.party_id = CA.party_id
AND hp.party_type in ('PERSON','ORGANIZATION')
AND HP.party_id = p_cust_party_id
AND CA.cust_account_id = p_cust_acct_id
AND (exists (SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = hp.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND salesforce_id = p_resource_id
)
)
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT site.party_site_id
FROM HZ_PARTIES hp,
HZ_PARTY_SITES site
WHERE site.party_id = hp.party_id
AND site.PARTY_SITE_ID = p_party_site_id --Added join for party_site_id
AND hp.status = 'A'
AND site.status = 'A'
AND hp.party_id in (p_party_id,p_cust_party_id)
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT site.party_site_id
FROM HZ_PARTIES hp,
HZ_PARTY_SITES site
WHERE site.party_id = hp.party_id
AND site.PARTY_SITE_ID = p_party_site_id --Added join for party_site_id
AND hp.status = 'A'
AND site.status = 'A'
AND hp.party_id = p_cust_party_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT site.party_site_id
FROM HZ_PARTIES hp,
HZ_PARTY_SITES site
WHERE site.party_id = hp.party_id
AND site.PARTY_SITE_ID = p_party_site_id --Added join for party_site_id
AND hp.status = 'A'
AND site.status = 'A'
AND hp.party_id = p_party_id
);
select 1 from dual where exists
(
SELECT MGR.group_id
FROM jtf_rs_rep_managers MGR ,
jtf_rs_group_usages U
WHERE U.usage = 'SALES'
AND U.group_id = MGR.group_id
AND trunc(MGR.start_date_active) <= trunc(SYSDATE)
AND trunc(NVL(MGR.end_date_active, SYSDATE)) >= trunc(SYSDATE)
AND MGR.parent_resource_id = MGR.resource_id
AND MGR.hierarchy_type in ('MGR_TO_MGR', 'MGR_TO_REP')
AND MGR.parent_resource_id = p_resource_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT ca.account_number
FROM HZ_PARTIES HP,
HZ_CUST_ACCOUNTS CA
WHERE hp.party_id = ca.party_id
AND hp.status = 'A'
AND ca.status = 'A'
AND trunc(nvl(ca.account_activation_date,sysdate)) <= trunc(sysdate)
AND trunc(nvl(ca.account_termination_date,sysdate)) >= trunc(sysdate)
AND HP.party_id = p_cust_party_id
AND ca.cust_account_id = p_cust_acct_id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
select ca.account_number
from HZ_PARTIES P
, HZ_CUST_ACCOUNTS CA
where CA.status = 'A'
AND trunc(nvl(CA.account_activation_date, SYSDATE)) <= trunc(SYSDATE)
AND trunc(nvl(CA.account_termination_date, SYSDATE)) >= trunc(SYSDATE)
AND P.status = 'A'
AND P.party_id = CA.party_id
AND (exists (SELECT null
FROM as_accesses_all secu
WHERE secu.customer_id = p.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL AND salesforce_id = p_resource_id
))
AND P.party_id = p_cust_party_id --Added joins for cust_account_id
AND ca.cust_account_id = p_cust_acct_id --and party id
);
SELECT 1 FROM DUAL WHERE EXISTS
(
select null
from HZ_PARTIES P
,HZ_CUST_ACCOUNTS CA
where CA.status = 'A'
AND P.status = 'A'
AND P.party_id = CA.party_id
AND P.party_id = p_cust_party_id --Added joins for cust_acct_id and
AND ca.cust_account_id = p_cust_acct_id --party id
AND EXISTS ( SELECT null
FROM as_accesses_all_all secu
WHERE secu.customer_id = P.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND secu.delete_flag is NULL
AND secu.sales_group_id in (
SELECT jrgd.group_id
FROM jtf_rs_groups_denorm jrgd,
jtf_rs_group_usages jrgu
WHERE jrgd.parent_group_id IN (
select U.group_id
from jtf_rs_rep_managers mgr,
jtf_rs_group_usages u
where mgr.parent_resource_id = p_resource_id
and trunc(sysdate) between trunc(mgr.start_date_active) and trunc(nvl(mgr.end_date_active,sysdate))
and mgr.hierarchy_type = 'MGR_TO_REP'
and mgr.group_id = u.group_id
and u.usage in ('SALES','PRM')
)
AND trunc(jrgd.start_date_active) <= TRUNC(SYSDATE)
AND trunc(NVL(jrgd.end_date_active, SYSDATE)) >= TRUNC(SYSDATE)
AND jrgu.group_id = jrgd.group_id
AND jrgu.usage in ('SALES', 'PRM')) )
UNION ALL
SELECT null
FROM as_accesses_all_all secu,HZ_PARTIES P
WHERE secu.customer_id = P.party_id
AND secu.lead_id IS NULL
AND secu.sales_lead_id IS NULL
AND secu.delete_flag is NULL
AND salesforce_id = p_resource_id --Added new join for salesforceid
);
aso_debug_pub.add('19. Value of P_QUOTE_HEADER_REC.LAST_UPDATE_DATE: '|| p_quote_header_rec.LAST_UPDATE_DATE,1,'Y');
aso_debug_pub.add('135. Value of p_quote_line_rec.LAST_UPDATE_DATE: '|| p_quote_line_rec.LAST_UPDATE_DATE,1,'Y');
aso_debug_pub.add('19. Value of x_QUOTE_HEADER_REC.LAST_UPDATE_DATE: '|| x_quote_header_rec.LAST_UPDATE_DATE,1,'Y');
aso_debug_pub.add('135. Value of x_quote_line_rec.LAST_UPDATE_DATE: '|| x_quote_line_rec.LAST_UPDATE_DATE,1,'Y');
select payment_type_code
from aso_payments
where quote_header_id = p_qte_hdr_id
and quote_line_id is null;
select b.invoice_to_cust_party_id
from aso_payments a, aso_quote_lines_all b
where a.quote_header_id = b.quote_header_id
and a.quote_line_id = b.quote_line_id
and b.quote_header_id = p_qte_hdr_id
and a.quote_line_id is not null
and a.payment_type_code is null
and b.invoice_to_cust_party_id is not null;
SELECT csm.ship_method_code
from wsh_carrier_ship_methods csm,
fnd_lookup_values fl
where fl.lookup_type = 'SHIP_METHOD'
and csm.ship_method_code = l_ship_method_code
and fl.view_application_id = 3
and csm.organization_id = l_org_id
and fl.enabled_flag = 'Y'
and csm.enabled_flag = 'Y'
and (trunc(sysdate) between nvl(fl.start_date_active,trunc(sysdate))
AND nvl(fl.end_date_active,trunc(sysdate)) );
select organization_id
from aso_quote_lines_all
where quote_line_id = l_qte_line_id;
select ship_method_code
from aso_shipments
where quote_line_id = l_qte_line_id;
select ship_method_code
from aso_shipments
where quote_header_id = l_qte_header;
ELSIF p_operation_code = 'UPDATE' THEN
-- get the value from the db if not passed in
IF (p_organization_id is null or p_organization_id = fnd_api.g_miss_num) then
open get_organization_id(p_qte_line_id);
aso_debug_pub.add('Operation code is UPDATE', 1, 'Y');