ORA-1722 "inavlid number" occured in case of valid number. [message #201853] |
Tue, 07 November 2006 01:39 |
deepayan
Messages: 51 Registered: December 2005
|
Member |
|
|
Dear All,
When I'm running im getting the error ORA-1722 invalid number. But I dont have any explanation for that.
select COUNT(DISTINCT aia.INVOICE_ID)
from ap_invoices_all aia,
ap_invoice_distributions_all aid,
hr_operating_units hou
where aia.invoice_id = aid.invoice_id and HOU.SET_OF_BOOKS_ID = 85 AND
((NVL(AID.MATCH_STATUS_FLAG, 'N') <> 'A' OR
(EXISTS (SELECT 'x'
FROM AP_HOLDS_ALL AHA
WHERE ((AHA.INVOICE_ID = AIA.INVOICE_ID) AND
AHA.RELEASE_REASON IS NULL))))) AND
AIA.ORG_ID = aid.org_id and aia.org_id = hou.organization_id
group by aia.ORG_ID
Any ideas regarding this will be highly appreciated.
The description of the tables are in the attached excel..
Thanks in advance...
-----------------
Deepayan..
|
|
|
|
|
|
Re: ORA-1722 "inavlid number" occured in case of valid number. [message #201896 is a reply to message #201891] |
Tue, 07 November 2006 04:35 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
The erroneous column does NOT necessarily be one of the two mentioned. It can still be HOU.SET_OF_BOOKS_ID.
Removing the condition probably changed the execution plan, maybe causing some records with non-numeric HOU.SET_OF_BOOKS_ID to be filtered out before coming to the HOU.SET_OF_BOOKS_ID=85 bit.
|
|
|
Re: ORA-1722 "inavlid number" occured in case of valid number. [message #201899 is a reply to message #201853] |
Tue, 07 November 2006 04:44 |
deepayan
Messages: 51 Registered: December 2005
|
Member |
|
|
Dear Littlefoot,
As per your instruction when im running
select COUNT(DISTINCT aia.INVOICE_ID)
from ap_invoices_all aia,
ap_invoice_distributions_all aid,
hr_operating_units hou
where aia.invoice_id = aid.invoice_id and HOU.SET_OF_BOOKS_ID = '85' AND
((NVL(AID.MATCH_STATUS_FLAG, 'N') <> 'A' OR
(EXISTS (SELECT 'x'
FROM AP_HOLDS_ALL AHA
WHERE ((AHA.INVOICE_ID = AIA.INVOICE_ID) AND
AHA.RELEASE_REASON IS NULL))))) AND
AIA.ORG_ID = aid.org_id and aia.org_id = hou.organization_id
group by aia.ORG_ID
is running fine.
but this query
select COUNT(DISTINCT aia.INVOICE_ID)
from ap_invoices_all aia,
ap_invoice_distributions_all aid,
hr_operating_units hou
where aia.invoice_id = aid.invoice_id and HOU.SET_OF_BOOKS_ID = 85 AND
((NVL(AID.MATCH_STATUS_FLAG, 'N') <> 'A' OR
(EXISTS (SELECT 'x'
FROM AP_HOLDS_ALL AHA
WHERE ((AHA.INVOICE_ID = AIA.INVOICE_ID) AND
AHA.RELEASE_REASON IS NULL))))) AND
AIA.ORG_ID = aid.org_id /*and aia.org_id = hou.organization_id*/
group by aia.ORG_ID
is running fine also..
If the problem is with HOU.SET_OF_BOOKS_ID = 85 then why the second query is running..
Can u tell where I can get some idea why its happening so..
-------------
Deepayan
|
|
|
|
|
|
|
|
|
|
|
|