<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ORA-01722 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127440#M862909</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When you getx the error ORA-01722 WHEN UPDATING A RECORD, HAVE YOU MIGRATED THE DATABASE TO you test environemnt successfulky. At what stage are you geting this error. During migration, or after migration and while issuing an update statement.&lt;BR /&gt;&lt;BR /&gt;If so then what data type in the field (column) value were you updating.&lt;BR /&gt;&lt;BR /&gt;When oracle cannot perform an automatic conversion then it has to throw ORA-01722. The ORA-01772 error is thrown up if you try and treat something as a number which is not numeric. This includes treating a NULL as a number.  Reasons could be the 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 functions or expressions. Only numeric fields may be added to or subtracted from dates. &lt;BR /&gt;&lt;BR /&gt;It doesn't matter that the columns are varchar and number type. The data conversion will cope with that.  What does matter is that the character column contains numberic data. At least one of the fields you are trying to insert/update contains a character string which cannot be converted to a number.  Your SQL either needs to cope with the exceptions, or the data needs to be cleaned up.&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;I hope this helps you ....&lt;BR /&gt;&lt;BR /&gt;IA</description>
    <pubDate>Mon, 24 Nov 2003 20:27:01 GMT</pubDate>
    <dc:creator>Indira Aramandla</dc:creator>
    <dc:date>2003-11-24T20:27:01Z</dc:date>
    <item>
      <title>ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127438#M862907</link>
      <description>Hi im having this problem with migrating the production database to the test system, the produktion system are in the instance SD01 and the Test system hasthe instance SD03, and the servers are, as i can see, idetical. Yet i get the ORA-01722 error when i try to update a record.&lt;BR /&gt;&lt;BR /&gt;Can anybody help ?</description>
      <pubDate>Mon, 24 Nov 2003 11:08:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127438#M862907</guid>
      <dc:creator>Jess Kristoffersen_2</dc:creator>
      <dc:date>2003-11-24T11:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127439#M862908</link>
      <description>This might be helpful:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.orafaq.com/error/ora-01722.htm" target="_blank"&gt;http://www.orafaq.com/error/ora-01722.htm&lt;/A&gt;</description>
      <pubDate>Mon, 24 Nov 2003 11:12:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127439#M862908</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-11-24T11:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127440#M862909</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When you getx the error ORA-01722 WHEN UPDATING A RECORD, HAVE YOU MIGRATED THE DATABASE TO you test environemnt successfulky. At what stage are you geting this error. During migration, or after migration and while issuing an update statement.&lt;BR /&gt;&lt;BR /&gt;If so then what data type in the field (column) value were you updating.&lt;BR /&gt;&lt;BR /&gt;When oracle cannot perform an automatic conversion then it has to throw ORA-01722. The ORA-01772 error is thrown up if you try and treat something as a number which is not numeric. This includes treating a NULL as a number.  Reasons could be the 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 functions or expressions. Only numeric fields may be added to or subtracted from dates. &lt;BR /&gt;&lt;BR /&gt;It doesn't matter that the columns are varchar and number type. The data conversion will cope with that.  What does matter is that the character column contains numberic data. At least one of the fields you are trying to insert/update contains a character string which cannot be converted to a number.  Your SQL either needs to cope with the exceptions, or the data needs to be cleaned up.&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;I hope this helps you ....&lt;BR /&gt;&lt;BR /&gt;IA</description>
      <pubDate>Mon, 24 Nov 2003 20:27:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127440#M862909</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2003-11-24T20:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127441#M862910</link>
      <description>Try doing a explain plan for the table on the two databases.&lt;BR /&gt;&lt;BR /&gt;That should help u</description>
      <pubDate>Mon, 24 Nov 2003 23:42:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127441#M862910</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-11-24T23:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127442#M862911</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you didn't post your SQL statement in error..&lt;BR /&gt;&lt;BR /&gt;Well, other than "by accident", the data is different, I'll guess one uses the CBO and one does not.&lt;BR /&gt;&lt;BR /&gt;Most probably, you are using a string to store a number instead of a number to store a number.  &lt;BR /&gt;&lt;BR /&gt;You should always compare STRINGS to STRINGS, DATES to DATES and NUMBERS to NUMBERS.  Never let an implicit conversion happen!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Consider the following example:&lt;BR /&gt;===================================================&lt;BR /&gt;yd@mydb.mu&amp;gt; create table ydtab&lt;BR /&gt;  2  (&lt;BR /&gt;  3   STARTOP  VARCHAR2(6) NOT NULL,&lt;BR /&gt;  4   ENDOP    VARCHAR2(6) NOT NULL&lt;BR /&gt;  5  )&lt;BR /&gt;  6  /&lt;BR /&gt;&lt;BR /&gt;Table created.&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; insert into ydtab values ( 'abc', 'def' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; insert into ydtab values ( '680', '682' );&lt;BR /&gt;&lt;BR /&gt;1 row created.&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; SELECT a.*&lt;BR /&gt;  2    FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,&lt;BR /&gt;  3                  TO_NUMBER(TRIM(ENDOP)) ECD&lt;BR /&gt;  4             FROM ydtab&lt;BR /&gt;  5            WHERE DECODE&lt;BR /&gt;  6                  ( &lt;BR /&gt;(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),&lt;BR /&gt;  7                    NULL, -9876121254,&lt;BR /&gt;  8                    -12345 ) = -9876121254&lt;BR /&gt;  9         ) a&lt;BR /&gt; 10  WHERE 681 &amp;gt;= SCD AND 681 &amp;lt;= ECD;&lt;BR /&gt;&lt;BR /&gt;       SCD        ECD&lt;BR /&gt;---------- ----------&lt;BR /&gt;       680        682&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; analyze table ydtab compute statistics;&lt;BR /&gt;&lt;BR /&gt;Table analyzed.&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; SELECT a.*&lt;BR /&gt;  2    FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,&lt;BR /&gt;  3                  TO_NUMBER(TRIM(ENDOP)) ECD&lt;BR /&gt;  4             FROM ydtab&lt;BR /&gt;  5            WHERE DECODE&lt;BR /&gt;  6                  ( &lt;BR /&gt;(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),&lt;BR /&gt;  7                    NULL, -9876121254,&lt;BR /&gt;  8                    -12345 ) = -9876121254&lt;BR /&gt;  9         ) a&lt;BR /&gt; 10  WHERE 681 &amp;gt;= SCD AND 681 &amp;lt;= ECD;&lt;BR /&gt;  FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,&lt;BR /&gt;                          *&lt;BR /&gt;ERROR at line 2:&lt;BR /&gt;ORA-01722: invalid number&lt;BR /&gt;&lt;BR /&gt;so, that is your problem here! &lt;BR /&gt;=&amp;gt;  you used a string to store a number instead of a number to store a number.  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is just a bug waiting to happen in your code -- You may be having dozens of problems like this lurking around.....  What you'll want to do is convert the strings to numbers in the DECODE and then use THAT result in the predicate.  &lt;BR /&gt;&lt;BR /&gt;The query should be:&lt;BR /&gt;&lt;BR /&gt;yd@mydb.mu&amp;gt; SELECT a.*&lt;BR /&gt;  2    FROM ( SELECT DECODE&lt;BR /&gt;  3                  ( &lt;BR /&gt;(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),&lt;BR /&gt;  4                    NULL, to_number(trim(STARTOP)) ) scd,&lt;BR /&gt;  5                  DECODE&lt;BR /&gt;  6                  ( &lt;BR /&gt;(REPLACE(TRANSLATE(TRIM(ENDOP),'0123456789','00000000000'),'0',NULL)),&lt;BR /&gt;  7                    NULL, to_number(trim(ENDOP)) ) ecd&lt;BR /&gt;  8             FROM ydtab&lt;BR /&gt;  9          ) a&lt;BR /&gt; 10   where scd &amp;lt;= 681&lt;BR /&gt; 11     and ecd &amp;gt;= 681&lt;BR /&gt; 12  /&lt;BR /&gt;&lt;BR /&gt;       SCD        ECD&lt;BR /&gt;---------- ----------&lt;BR /&gt;       680        682&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 25 Nov 2003 01:26:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127442#M862911</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-11-25T01:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01722</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127443#M862912</link>
      <description>dear people .. iÂ´ve just had same problem, but i tried to match oracle 8.1.7 NLS_LANG with local application server ( SD ) registry under HK_LOCAL_MACHINE/software/oracle.&lt;BR /&gt;&lt;BR /&gt;Well, but when i tried to insert/update any registry within incident, problem and so on he gave me an oracle error )RA-01722, invalid number ... and the INSERT INTO ITSM_INCIDENT line with values ...&lt;BR /&gt;&lt;BR /&gt;well, what solved my problem was changing the regional settings in the application server ( SD ) to english .. ( I am in Brazil, and service desk and the database use AMERICAN language). So, hope this help</description>
      <pubDate>Wed, 13 Oct 2004 13:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ora-01722/m-p/3127443#M862912</guid>
      <dc:creator>Eduardo Ligeiro</dc:creator>
      <dc:date>2004-10-13T13:21:06Z</dc:date>
    </item>
  </channel>
</rss>

