- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ORA-01722
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 03:08 AM
тАО11-24-2003 03:08 AM
ORA-01722
Can anybody help ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 03:12 AM
тАО11-24-2003 03:12 AM
Re: ORA-01722
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 12:27 PM
тАО11-24-2003 12:27 PM
Re: ORA-01722
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.
If so then what data type in the field (column) value were you updating.
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.
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.
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.
I hope this helps you ....
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 03:42 PM
тАО11-24-2003 03:42 PM
Re: ORA-01722
That should help u
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 05:26 PM
тАО11-24-2003 05:26 PM
Re: ORA-01722
you didn't post your SQL statement in error..
Well, other than "by accident", the data is different, I'll guess one uses the CBO and one does not.
Most probably, you are using a string to store a number instead of a number to store a number.
You should always compare STRINGS to STRINGS, DATES to DATES and NUMBERS to NUMBERS. Never let an implicit conversion happen!
Consider the following example:
===================================================
yd@mydb.mu> create table ydtab
2 (
3 STARTOP VARCHAR2(6) NOT NULL,
4 ENDOP VARCHAR2(6) NOT NULL
5 )
6 /
Table created.
yd@mydb.mu> insert into ydtab values ( 'abc', 'def' );
1 row created.
yd@mydb.mu> insert into ydtab values ( '680', '682' );
1 row created.
yd@mydb.mu>
yd@mydb.mu> SELECT a.*
2 FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,
3 TO_NUMBER(TRIM(ENDOP)) ECD
4 FROM ydtab
5 WHERE DECODE
6 (
(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),
7 NULL, -9876121254,
8 -12345 ) = -9876121254
9 ) a
10 WHERE 681 >= SCD AND 681 <= ECD;
SCD ECD
---------- ----------
680 682
yd@mydb.mu> analyze table ydtab compute statistics;
Table analyzed.
yd@mydb.mu>
yd@mydb.mu> SELECT a.*
2 FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,
3 TO_NUMBER(TRIM(ENDOP)) ECD
4 FROM ydtab
5 WHERE DECODE
6 (
(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),
7 NULL, -9876121254,
8 -12345 ) = -9876121254
9 ) a
10 WHERE 681 >= SCD AND 681 <= ECD;
FROM ( SELECT TO_NUMBER(TRIM(STARTOP)) SCD,
*
ERROR at line 2:
ORA-01722: invalid number
so, that is your problem here!
=> you used a string to store a number instead of a number to store a number.
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.
The query should be:
yd@mydb.mu> SELECT a.*
2 FROM ( SELECT DECODE
3 (
(REPLACE(TRANSLATE(TRIM(STARTOP),'0123456789','00000000000'),'0',NULL)),
4 NULL, to_number(trim(STARTOP)) ) scd,
5 DECODE
6 (
(REPLACE(TRANSLATE(TRIM(ENDOP),'0123456789','00000000000'),'0',NULL)),
7 NULL, to_number(trim(ENDOP)) ) ecd
8 FROM ydtab
9 ) a
10 where scd <= 681
11 and ecd >= 681
12 /
SCD ECD
---------- ----------
680 682
hth
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 06:21 AM
тАО10-13-2004 06:21 AM
Re: ORA-01722
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 ...
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