Order sales online - Issue while selecting shipping address - oracle

oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
SELECT *
FROM (
select HzPuiPartySiteEO.party_site_id,
HzPuiPartySiteEO.party_id,
HzPuiPartySiteEO.location_id,
loc.country as country_code,
terr.territory_short_name as country,
loc.state,
loc.province,
loc.county,
loc.postal_code,
HzPuiPartySiteEO.actual_content_source,
HzPuiPartySiteEO.identifying_address_flag,
HzPuiPartySiteEO.status,
hz_utility_v2pub.get_all_purposes(
HzPuiPartySiteEO.party_site_id) all_purposes,
hz_utility_v2pub.get_site_use_purpose(
HzPuiPartySiteEO.party_site_id) use,
hz_utility_v2pub.get_yahoo_map_url(
loc.address1, loc.address2, loc.address3,
loc.address4, loc.city, loc.country,
loc.state, loc.postal_code) mapUrl,
HzPuiPartySiteEO.mailstop,
p.party_name
from hz_party_sites HzPuiPartySiteEO,
hz_parties p,
hz_locations loc,
fnd_territories_vl terr
where p.party_id = :1
and p.party_id = HzPuiPartySiteEO.party_id
and HzPuiPartySiteEO.location_id = loc.location_id
and HzPuiPartySiteEO.status = 'A'
and terr.territory_code = loc.country
UNION ALL
SELECT HzPuiPartySiteEO.party_site_id,
HzPuiPartySiteEO.party_id,
HzPuiPartySiteEO.location_id,
loc.country AS country_code,
terr.territory_short_name AS country,
loc.state,
loc.province,
loc.county,
loc.postal_code,
HzPuiPartySiteEO.actual_content_source,
HzPuiPartySiteEO.identifying_address_flag,
HzPuiPartySiteEO.status,
hz_utility_v2pub.get_all_purposes( HzPuiPartySiteEO.party_site_id) all_purposes,
hz_utility_v2pub.get_site_use_purpose( HzPuiPartySiteEO.party_site_id) use,
hz_utility_v2pub.get_yahoo_map_url( loc.address1, loc.address2, loc.address3, loc.address4, loc.city, loc.country, loc.state, loc.postal_code) mapUrl,
HzPuiPartySiteEO.mailstop,
p.party_name
FROM hz_party_sites HzPuiPartySiteEO,
hz_parties p,
hz_locations loc,
hz_party_site_uses hpsu,
fnd_territories_vl terr
WHERE p.party_id in (select hrel.object_id from hz_relationships hrel
where hrel.subject_id=:2
and ( (hrel.relationship_code IN ( 'CUSTOMER_INDIRECTLY_MANAGED_BY' ,'Financed By') AND :3 <> 'FLEET_DIRECT')
OR (hrel.relationship_code IN ( 'CUSTOMER_INDIRECTLY_MANAGED_BY' ,'Financed By','Direct Fleet Manager of') AND :4 = 'FLEET_DIRECT')
)
and hrel.status = 'A'
AND TRUNC(NVL(hrel.end_date,sysdate)) >= TRUNC(SYSDATE)
)
and hpsu.party_site_id = HzPuiPartySiteEO.party_site_id
and hpsu.site_use_type = 'BILL_TO'
AND p.party_id = HzPuiPartySiteEO.party_id
AND HzPuiPartySiteEO.location_id = loc.location_id
AND HzPuiPartySiteEO.status = 'A'
AND terr.territory_code = loc.country) QRSLT WHERE (COUNTRY_CODE = :2) ORDER BY identifying_address_flag desc
It is a upgarde project from 12.1.3 to 12.2.9 , In the 12.2.9 version we have created quote and after that in shipping and billing filed after clicking on select button for selecting the address for shipping it is throwing an error.

Related

Issues returning multiple rows for one user in Oracle BIP SQL Query

SELECT
PAPF.PERSON_NUMBER as PERSONNUMBER,
PNI.NATIONAL_IDENTIFIER_NUMBER as NATIONALIDENTIFIER,
PPNFV.FIRST_NAME as FIRSTNAME,
PPNFV.MIDDLE_NAMES as MIDDLENAME,
PPNFV.LAST_NAME as LASTNAME,
PAAM.ASSIGNMENT_STATUS_TYPE as EMPLOYMENTSTATUS,
PPOS.DATE_START AS HIREDATE,
PPOS.ORIGINAL_DATE_OF_HIRE as WORKRELATIONSHIPSTARTDATE,
PPOS.ACTUAL_TERMINATION_DATE as TERMINATIONDATE,
PP.DATE_OF_BIRTH as DOB,
PPLF.SEX as GENDER,
PAAM.EMPLOYMENT_CATEGORY as ASSIGNMENTCATEGORY,
PJLG.INFORMATION1 as FLSA,
CS.SALARY_BASIS_CODE as HOURLYSALARY,
paam.effective_start_date as ASSIGNMENTSTARTDATE,
PAAM.ASSIGNMENT_NAME as JOBTITLE,
PJFV.JOB_CODE as JOBCODE,
NVL(email.email_address,'none') as EMAIL,
CS.SALARY_AMOUNT as PAY,
CS.SALARY_BASIS_CODE as PAYTYPE,
CS.DATE_FROM as PAYEFFECTIVEDATE,
PAF.ADDRESS_LINE_1 as HOMEADDRESS1,
PAF.ADDRESS_LINE_2 as HOMEADDRESS2,
PAF.TOWN_OR_CITY as HOMECITY,
PAF.REGION_2 as HOMESTATE,
PAF.POSTAL_CODE as HOMEPOSTALCODE,
HLA.ADDRESS_LINE_1 as WORKADDRESS1,
HLA.ADDRESS_LINE_2 as WORKADDRESS2,
HLA.TOWN_OR_CITY as WORKCITY,
HLA.REGION_2 as WORKSTATE,
HLA.POSTAL_CODE as WORKPOSTALCODE
FROM
PER_ALL_PEOPLE_F PAPF,
PER_PERIODS_OF_SERVICE PPOS,
PER_ALL_ASSIGNMENTS_M PAAM,
PER_PERSONS PP,
PER_NATIONAL_IDENTIFIERS PNI,
PER_PERSON_NAMES_F_V PPNFV,
PER_JOBS_F_V PJFV,
PER_PEOPLE_LEGISLATIVE_F PPLF,
PER_ADDRESSES_F PAF,
HR_LOCATIONS_ALL HLA,
PER_JOB_LEG_F PJLG,
PER_EMAIL_ADDRESSES EMAIL,
CMP_SALARY CS,
PER_PERSON_ADDR_USAGES_F PPAUF
WHERE
cs.assignment_id = paam.assignment_id
AND paam.effective_start_date between cs.date_from and cs.date_to
AND ppnfv.name_type = 'GLOBAL'
AND paam.assignment_type = 'E'
AND paam.primary_flag = 'Y'
AND paam.job_id = pjfv.job_id
AND email.email_type = 'W1'
AND papf.person_id = ppnfv.person_id
AND PNI.person_id = paam.person_id
AND paam.person_id = pplf.person_id
AND paam.job_id = pjlg.job_id
AND ppauf.person_id = papf.person_id
AND ppauf.address_type = 'HOME'
AND ppauf.address_id = paf.address_id
AND pp.person_id = paam.person_id
AND TRUNC(SYSDATE) BETWEEN paam.effective_start_date and paam.effective_end_date
AND paam.period_of_service_id = ppos.period_of_service_id
AND papf.person_id = paam.person_id
AND ppnfv.person_id = paam.person_id
AND hla.location_id = paam.location_id
AND pjlg.job_id = paam.job_id
AND papf.person_id = email.person_id
AND TRUNC(SYSDATE) BETWEEN cs.date_from and cs.date_to
AND TRUNC(SYSDATE) BETWEEN ppnfv.effective_start_date and ppnfv.effective_end_date
AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date and papf.effective_end_date
AND TRUNC(SYSDATE) BETWEEN paf.effective_start_date and paf.effective_end_date
AND TRUNC(SYSDATE) BETWEEN pjfv.effective_start_date and pjfv.effective_end_date
AND TRUNC(SYSDATE) BETWEEN hla.effective_start_date and hla.effective_end_date
AND TRUNC(SYSDATE) BETWEEN pjlg.effective_start_date and pjlg.effective_end_date
AND TRUNC(SYSDATE) BETWEEN ppauf.effective_start_date and ppauf.effective_end_date
AND TRUNC(SYSDATE) BETWEEN pp.effective_start_date and pp.effective_end_date
AND TRUNC(SYSDATE) BETWEEN pni.effective_start_date and pni.effective_end_date
ORDER BY PAPF.PERSON_NUMBER
Hi All! Returning multiple rows for each person and cannot figure out why. Not hitting any syntax errors, it's just that I'm returning multiple rows for each user (which has the downstream effect of timing out any reports I tie to this query.) Anyone have any ideas about how to resolve?
Thanks!
Each one of your tables should have a primary key column. Add those to your output. Add a where clause to select one person from the results. You should then be able to find the column with different values on each output row to determine which table is causing the problem.

why SSRS asking to Define query parameters when already defined?

I have the below query which is working well in SQL. But when I use this query in ssrs(Visual studio 2015) it is giving me error saying define query parameters. I have already defined values for parametes but still getting the error. I feel something from the SQL query which s not getting supported in SSRS. Can anyone help?
[![SET FMTONLY OFF
USE GODSDB
declare
#start date = getdate() - 100
, #end date = getdate()
drop table #CallLog
declare #code varchar(max), #TableName varchar(max), #SeverName varchar(max)
--IF object_id('tempdb..#CallLog') IS NOT NULL DROP TABLE #CallLog
CREATE TABLE #CallLog (
\[JurisdictionShortIdentifier\] VARCHAR(100),
\[ContractCallLogOID\] INT,
\[ContractCallLogProcessQueueOID\] INT,
\[ContractOID\] INT,
\[CallDate\] DATETIME,
\[CallHandledBy\] VARCHAR(60),
\[CallLogOldGreenUnit\] INT,
\[CallLogNewGreenUnit\] INT,
\[Comment\] VARCHAR(7500)
)
set #TableName = '#CallLog'
set #SeverName = 'BA_GBASSTOCSISDB' -- sp_linkedservers
set #code = '
;with XMLNAMESPACES(DEFAULT ''http://tempuri.org/GEOUnit.xsd'')
select
ccl.JurisdictionShortIdentifier,
ccl.ContractCallLogOID,
que.ContractCallLogProcessQueueOID,
ccl.ContractOID,
ccl.db_insertDate as CallDate,
ccl.db_insertBy as CallHandledBy,
convert(xml, que.XMLString).value(''(/GEOUnit/GreenPowerUnits/GreenPowerUnitsOld)\[1\]'',''int'') as CallLogOldGreenUnit,
convert(xml, que.XMLString).value(''(/GEOUnit/GreenPowerUnits/GreenPowerUnitsNew)\[1\]'',''int'') as CallLogNewGreenUnit,
cmt.Comment
from CSISDB.dbo.ContractCallLog as ccl (nolock)
left join CSISDB.dbo.ContractCallLogProcessQueue as que (nolock) on ccl.ContractCallLogOID = que.ContractCallLogOID
left join CSISDB.dbo.Comment as cmt (nolock) on ccl.ContractCallLogOID = cmt.FKObjectOID and cmt.FKTableObjectOID = 1008
where 1 = 1
and ccl.ContractCallLogStatusIdentifier in (''GMOD'', ''GUS'', ''GI'')
and ccl.ContractCallLogReasonIdentifier in (''Changed'', ''GEOR'', ''NULL'', ''GEO'', ''GEO0'', ''GEO1'', ''GEO3'', ''GEO2'', ''CDR'', ''GEO4'', ''GEO5'', ''JUST GREEN adder'', ''JustGreen'')
--and ccl.JurisdictionShortIdentifier = ''AG''
and ccl.SourceSystemIdentifier = ''GBASS''
and ccl.db_insertDate between #start and #end
--and ccl.ContractCallLogOID = 57131879 --> TEST CASE
'
set #code = replace(#code, '#start', '''' + convert(varchar, convert(date, #start, 101)) + '''')
set #code = replace(#code, '#end', '''' + convert(varchar, convert(date, dateadd(day, 1, #end), 101)) + '''')
set #code = concat('insert into ', #TableName, ' select * from openquery (', #SeverName, ', ''' , replace(#code, '''', '''''') , ''')')
print #code
exec(#code)
-- select * from #CallLog where ContractCallLogOID = 57707501
-- some call log have multiple process queues, delete the process queues that don't is not modifying the geo units
delete a
from #CallLog as a
inner join #CallLog as b on a.ContractCallLogOID = b.ContractCallLogOID
and a.ContractCallLogProcessQueueOID != b.ContractCallLogProcessQueueOID
and a.CallLogNewGreenUnit is null
and b.CallLogNewGreenUnit is not null
--select * from #CallLog
select
ccl.JurisdictionShortIdentifier,
ccl.ContractCallLogOID,
ccl.ContractCallLogProcessQueueOID,
cnt.RtlrContractIdentifier,
ccl.ContractOID,
cst.ContractStatusIdentifier as ContractStatus,
ccl.CallLogOldGreenUnit,
ccl.CallLogNewGreenUnit,
cur.GreenLevelIndicator as CurrentGreenUnit,
cur.db_insertDate as GreenUnitLastUpdateDate,
cur.db_insertBy as GreenUnitLastUpdateBy,
ccl.CallDate,
ccl.CallHandledBy,
ccl.Comment
from #CallLog as ccl
inner join Contract as cnt (nolock) on ccl.ContractOID = cnt.ContractOID
and ccl.CallLogOldGreenUnit != ccl.CallLogNewGreenUnit
inner join ContractState as cst (nolock) on cnt.ContractOID = cst.ContractOID
left join ContractGreenContent as cur (nolock) on cnt.ContractOID = cur.ContractOID
and isnull(cur.EffectiveEndDate, dateadd(day, 1, getdate())) >= getdate()
left join ContractGreenContent as his (nolock) on cnt.ContractOID = his.ContractOID
and ccl.CallLogNewGreenUnit = his.GreenLevelIndicator
and his.db_insertDate between dateadd(day, -1, ccl.CallDate) and dateadd(day, 1, ccl.CallDate)
where his.ContractGreenContentOID is null
--select * from #CallLog
union all
select
ccl.JurisdictionShortIdentifier,
ccl.ContractCallLogOID,
ccl.ContractCallLogProcessQueueOID,
cnt.RtlrContractIdentifier,
ccl.ContractOID,
cst.ContractStatusIdentifier as ContractStatus,
ccl.CallLogOldGreenUnit,
ccl.CallLogNewGreenUnit,
cur.GreenLevelIndicator as CurrentGreenUnit,
cur.db_insertDate as GreenUnitLastUpdateDate,
cur.db_insertBy as GreenUnitLastUpdateBy,
ccl.CallDate,
ccl.CallHandledBy,
ccl.Comment
from #CallLog as ccl
inner join Contract as cnt (nolock) on ccl.ContractOID = cnt.ContractOID
and isnull(ccl.CallLogOldGreenUnit, 0) = isnull(ccl.CallLogNewGreenUnit, 0)
inner join ContractState as cst (nolock) on cnt.ContractOID = cst.ContractOID
left join ContractGreenContent as cur (nolock) on cnt.ContractOID = cur.ContractOID
and isnull(cur.EffectiveEndDate, dateadd(day, 1, getdate())) >= getdate()
SET FMTONLY ON][1]][1]
Make sure your parameter names and SQL variables are all spelled exactly the same, they are case sensitive.
Also try declaring each variable on it own line with its own DECLARE statement. I've seen this fix this issue 'sometimes'
Your parameters are inside your #SQL query variable. The server that you are running the OPENQUERY from doesn't recognize the parameters since they were declared on another server.
Put the parameter declarations inside your SQL variable:
set #code = '
declare
#start date = getdate() - 100
, #end date = getdate()
...

Column ambiguously defined Oracle SQL

I'm facing this ambiguously defined error. I understand this is due to alias not defined properly but I am not able to understand in the below query why this error is coming. I'm using Oracle.
SELECT
papf.person_number as personnumber,
paam.position_id as position,
fabu.bu_name
FROM
(SELECT
papf.person_number,
paam.person_id,
fabu.bu_name,
fabu.bu_id,
paam.assignment_id,
paam.assignment_number,
paam.action_code,
paam.effective_start_date,
wft.outcome,
htd.state,
htd.status,
Count(paam.assignment_id)
over (
PARTITION BY paam.assignment_id) rowcnt
FROM
per_all_assignments_m paam,
per_all_people_f papf,
hrc_txn_header hth,
hrc_arm_process_vl hapv,
hrc_txn_data htd,
fa_fusion_soainfra.wftask wft,
fun_all_business_units_v fabu
WHERE
paam.primary_assignment_flag = 'Y'
AND paam.effective_latest_change = 'Y'
AND paam.assignment_status_type = 'ACTIVE'
AND paam.action_code IN ( 'GLB_TRANSFER', 'TRANSFER' )
AND hth.subject = 'PER_ALL_PEOPLE_F'
AND hth.subject_id = paam.person_id
AND hth.object IN ( 'PER_ALL_ASSIGNMENTS_M', 'PER_ALL_PEOPLE_F' )
AND hth.object_id = Decode(hth.object, 'PER_ALL_ASSIGNMENTS_M', paam.assignment_id,
'PER_ALL_PEOPLE_F', paam.person_id)
AND hapv.process_id = hth.process_id
AND hapv.txn_module_identifier IN ( 'Transfers', 'ManageEmployment', 'AddWorkRelationship' )
AND htd.transaction_id = hth.transaction_id
AND wft.identificationkey = To_char(hth.transaction_id)
AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND paam.person_id = papf.person_id
and sysdate between fabu.date_from and fabu.date_to
and fabu.status='A'
and paam.business_unit_id=fabu.bu_id
GROUP BY papf.person_number,
paam.person_id,
paam.assignment_id,
fabu.bu_name,
fabu.bu_id,
paam.assignment_number,
paam.action_code,
paam.effective_start_date,
wft.outcome,
htd.state,
htd.status) t1,
per_all_people_f papf,
per_all_assignments_m paam,
fun_all_business_units_v fabu
WHERE rowcnt = 1
AND outcome = 'APPROVE'
AND state = 'COMPLETE'
AND status = 'APPROVED'
AND paam.person_id = t1.person_id
AND paam.action_code = t1.action_code
AND paam.assignment_status_type = 'INACTIVE'
AND paam.assignment_sequence = 1
AND paam.effective_start_date = t1.effective_start_date
AND paam.assignment_type = 'E'
and papf.person_id = t1.person_id
AND papf.effective_start_date = t1.effective_start_date
AND fabu.bu_id = t1.bu_id
I'm defining the paam table and papf table the same way and not facing issue in them.
Why I am facing this error when I try to add fabu table in end ?
You forgot to add t1. when refer to some columns that can be found in other tables:
WHERE t1.rowcnt = 1
AND t1.outcome = 'APPROVE'
AND t1.state = 'COMPLETE'
AND t1.status = 'APPROVED'

ORA-01427: Subquery returns more than one row

When I execute the query below, I get the message like this: "ORA-01427: Sub-query returns more than one row"
Define REN_RunDate = '20160219'
Define MOP_ADJ_RunDate = '20160219'
Define RID_RunDate = '20160219'
Define Mbr_Err_RunDate = '20160219'
Define Clm_Err_RunDate = '20160219'
Define EECD_RunDate = '20160219'
select t6.Member_ID, (Select 'Y' from MBR_ERR t7 where t7.Member_ID = t6.Member_ID and t7.Rundate = &Mbr_Err_RunDate ) Mbr_Err,
NVL(Claim_Sent_Amt,0) Sent_Claims, Rejected_Claims,Orphan_Claim_Amt,Claims_Accepted, MOP_Adj_Sent Sent_MOP_Adj,Net_Sent,
(Case
When Net_Sent < 45000 then 0
When Net_Sent > 25000 then 20500
Else
Net_Sent - 45000
End
)Net_Sent_RI,
' ' Spacer,
Total_Paid_Claims CMS_Paid_Claims, MOP_Adjustment CM_MOP_Adj, MOP_Adjusted_Paid_claims CM_Net_Claims, Estimated_RI_Payment CM_RI_Payment
from
(
select NVL(t3.Member_ID,t5.Member_ID)Member_ID, t3.Claim_Sent_Amt, NVL(t4.Reject_Claims_Amt,0) Rejected_Claims, NVL( t8.Orphan_Amt,0) Orphan_Claim_Amt,
(t3.Claim_Sent_Amt - NVL(t4.Reject_Claims_Amt,0) - NVL(t8.Orphan_Amt,0)) Claims_Accepted,
NVL(t2.MOP_Adj_Amt,0) MOP_Adj_Sent ,
( (t3.Claim_Sent_Amt - NVL(t4.Reject_Claims_Amt,0)) - NVL(t2.MOP_Adj_Amt,0) - NVL(t8.Orphan_Amt,0) ) Net_Sent,
t5.Member_ID CMS_Mbr_ID,t5.Total_Paid_Claims,t5.MOP_Adjustment, t5.MOP_Adjusted_Paid_Claims, t5.Estimated_RI_Payment
From
(
Select t1.Member_ID, Sum( t1.Paid_Amount) Claim_Sent_Amt
From RENS t1
where t1.rundate = &REN_RunDate
group by t1.Member_ID
) t3
Left Join MOP_ADJ t2
on (t3.Member_ID = t2.Member_ID and t2.rundate = &MOP_ADJ_RunDate)
Left Join
(select Member_ID, sum(Claim_Total_Paid_Amount) Reject_Claims_Amt from CLAIM_ERR
where Rundate = &Claim_Err_RunDate
and Claim_Total_Paid_Amount != 0
Group by member_ID
)t4
on (t4.Member_ID = t3.Member_ID )
Full Outer Join
(
select distinct Member_ID,Total_Paid_Claims,MOP_Adjustment,MOP_Adjusted_Paid_Claims, Estimated_RI_Payment
from RID
where Rundate = &RID_RunDate
and Estimated_RI_Payment != 0
)t5
On(t5.Member_ID = t3.Member_ID)
Left Outer Join
(
select Member_ID, Sum(Claim_Paid_Amount) Orphan_Amt
From EECD
where RunDate = &EECD_RunDate
group by Member_ID
)t8
On(t8.Member_ID = t3.Member_ID)
)t6
order by Member_ID
You have this expression among the select columns (at the top of your code):
(Select 'Y' from MBR_ERR t7 where t7.Member_ID = t6.Member_ID
and t7.Rundate = &Mbr_Err_RunDate ) Mbr_Err
If you want to select the literal 'Y', then just select 'Y' as Mbr_Err. If you want to select either 'Y' or null, depending on whether the the subquery returns exactly one row or zero rows, then write it that way.
I suspect this subquery (or perhaps another one in your code, used in a similar way) returns more than one row - in which case you will get exactly the error you got.

IRISO Status Query Required

I require a query where I pass Internal Requisition No and gets the following Columns:
Item_Description, Requisition QTY Ordered, Reqisition qty Received, Intransit Qty, SO Ordered qty, SO Shipped qty, SO cancelled qty.
I have already written a query but its not working well....Plz help and Thanks in Advance
SELECT msi.segment1 item,
msi.description,
prla.quantity Req_Qty_Order,
prla.quantity_received Req_qty_Received,
(SELECT quantity FROM mtl_supply
WHERE req_header_id =
(SELECT REQUISITION_HEADER_ID FROM po_requisition_headers_all
WHERE segment1 = &&value1
AND creation_date = (SELECT MAX (creation_date)
FROM po_requisition_headers_all
WHERE segment1 = &&value1))
AND supply_type_code = 'SHIPMENT') Intransit_Qty,
prla.quantity_delivered,
ool.ordered_quantity SO_Qty_Ordered,
ool.shipped_quantity SO_Qty_Shipped,
ool.cancelled_quantity SO_Qty_Cancelled
FROM po_requisition_headers_all prha,
po_requisition_lines_all prla,
mtl_system_items_b msi,
oe_order_headers_all ooh,
oe_order_lines_all ool,
org_organization_definitions org
WHERE prha.requisition_header_id = prla.requisition_header_id
AND prha.type_lookup_code = 'INTERNAL'
AND msi.inventory_item_id = prla.item_id
AND prla.DESTINATION_ORGANIZATION_ID = msi.ORGANIZATION_ID
AND ooh.header_id = ool.header_id
AND org.ORGANIZATION_ID = ool.SHIP_FROM_ORG_ID
AND ooh.source_document_id = prha.requisition_header_id
AND prla.REQUISITION_LINE_ID = ool.source_document_line_id
AND prha.authorization_status LIKE 'APPROVED'
AND prha.segment1 = number_to_be_given;

Resources