Error Code 1722 Error Message Ora-01722 Invalid Number
Contents |
SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog
ora 01722 invalid number error in informatica ORA-01722: invalid number tips Oracle ErrorOra 01722 Invalid Number Oracle Decode
Tips by Burleson Consulting Oracle docs offer this information regarding Oracle ORA-01722: ORA-01722 invalid number Cause: The ora 01722 invalid number while upgrade attempted conversion of a character string to a number failed because the character string was not a valid numeric literal. Only numeric fields or character fields containing numeric data may be used in arithmetic ora 01722 invalid number date conversion functions or expressions. Only numeric fields may be added to or subtracted from dates. Action: Check the character strings in the function or expression. Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation. Jonathan Gennick provides information regarding Oracle ORA-01722 in conjunction with subqueries and Oracle Optimizer. To exhibit how Oracle ORA-01722 is often thrown,
Ora 01722 Invalid Number Oracle Date
this query is given as an example: SELECT * FROM ( SELECT FLAG, TO_NUMBER ( NUM ) NUM FROM SUBTEST WHERE FLAG = 'N' ) WHERE NUM > 0 ; Here, from in the FROM clause of a query, the user is attempting to have a subquery of the original query, which is causing Oracle ORA-01722 to be thrown. The Oracle ORA-01722 error is thrown with the failure because of the outer query. This is because it is trying to test the NUM > 0 condition first because it is assumed it might be more useful. Gennick goes on to show that Oracle ORA-01722 is thrown because the Oracle optimizer has re-written the query as: SELECT FLAG, TO_NUMBER ( NUM ) NUM FROM SUBTEST WHERE TO_NUMBER ( NUM ) > 0 AND FLAG = 'N' ; This throws Oracle ORA-01722 because the re-written query causes the system to convert a non-numeric NUM value of the WHERE clause into numbers. OraFaq also has notes on Oracle ORA-01722. Here, it is explained that Oracle ORA-01722 is thrown because a particular string was not able o be converted into a specific valid number when a user attempted to convert a character string. There are several possible resolution
17, 2012 - 9:21 am UTC Category: – Version: Latest Followup You Asked What is the error ORA-01722 and we said... ORA-1722 is Invalid number. We've attempted ora 01722 invalid number ora 02063 preceding line from to either explicity or implicity convert a character string to a number 01722. 00000 - "invalid number" and it is failing. This can happen for a number of reasons. It generally happens in SQL only
Ora-01722 Invalid Number Solution
(during a query) not in plsql (plsql throws a different exception for this error). You can see this error easily by: ops$tkyte@8i> select to_number('abc') from dual; select to_number('abc') from dual * http://www.dba-oracle.com/sf_ora_01722_invalid_number.htm ERROR at line 1: ORA-01722: invalid number This error seems to creep into queries in the strangest ways. A change in the order of a predicate can make it come and go -- depending on the order of evaluation in the predicate. Consider this example: ops$tkyte@8i> create table t ( x int, y varchar2(25) ); Table created. ops$tkyte@8i> ops$tkyte@8i> insert into t https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:45012348053 values ( 1, 'abc' ); 1 row created. ops$tkyte@8i> insert into t values ( 2, '123' ); 1 row created. ops$tkyte@8i> ops$tkyte@8i> ops$tkyte@8i> select * from t where y > 100 and x = 2; X Y ---------- ------------------------- 2 123 ops$tkyte@8i> select * from t where x = 2 and y > 100; select * from t where x = 2 and y > 100 * ERROR at line 1: ORA-01722: invalid number The first query worked since we *tend* to evaluate queries from the bottom up. We evaluated the x=2 part first and never tried to do 'abc' > 100. In the second query, the y>100 was evaluated first. Y was promoted to a number and then compared to 100. 'abc' could not be converted so ORA-1722. The only general purpose solution is to always compare like types to like types. You should either convert the column Y entirely to numbers (clean the data) or use a character string comparision (which changes the meaning of the predicate -- y > 100 is very different from y > '100' ) Reviews Wr
number" occured in case of valid number. [message #201853] Tue, 07 November 2006 01:39 deepayan http://www.orafaq.com/forum/t/71962/2/ Messages: 51Registered: 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' invalid number 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.. Attachment: description of tables.xls (Size: 33.00KB, 01722 invalid number Downloaded 1140 times) Report message to a moderator Re: ORA-1722 "inavlid number" occured in case of valid number. [message #201856 is a reply to message #201853] Tue, 07 November 2006 01:57 Littlefoot Messages: 20835Registered: June 2005 Location: Croatia, Europe Senior MemberAccount Moderator Sorry, but I don't open potentially dangerous files from unknown sources (including XLS ones). As for invalid number error, check whether columns used in the WHERE clause are numbers. This one might be a problem: HOU.SET_OF_BOOKS_ID = 85 If this column is of a CHARACTER data type, 85 should be enclosed into single quotes. Report message to a moderator Re: ORA-1722 "inavlid number" occured in case of valid number. [message #201879 is a reply to message #201853] Tue, 07 November 2006 03:09 deepayan Messages: 51Registered: December 2005 Member Dear littlefoot, I found the erronious part of the where clause is "aia.org_id = hou.organization_id" .