Ora 01722 неверное число как исправить
Платформа (8.3.10.2466), Внешний источник oracle DRIVER=
При попытке записи набора во внешний источник данных ошибка
ошибка при выполнении запроса: Ошибка ODBC. SQLSTATE: 22018
Номер ошибки: 1722
Описание: [Oracle][ODBC][Ora]ORA-01722: неверное число
при этом если отладкой пройтись, бывает пропускает без ошибок и записывает данные в таблицу
ставлю на то, что вы пихаете строковое представление числа в числовое поле и оно содержит неразрывный пробел (если больше или равно 1000) и/или запятую вместо точки (если содержит дробную часть)
Ora 01722 неверное число как исправить
Здравствуйте!
Установили на сервер платформу 8.3.17.1496 х64. При загрузке бэкапа в базу возникает ошибка: «ошибка загрузки информационной базы. В информационную базу загружены не все данные по причине: Ошибка СУБД: ORA-01722: неверное число». Решили проверить платформу 8.3.17.1386, ошибка осталась. Проверяли на БП и ЗУП.
Подскажите в чём может быть проблема?
А на 8.3.16 то же самое?
А с оригинальной базой что? Работает?
(1) Рабочая на 8.3.15.1830 работает. 8.3.16 не проверяли.
(2) то есть на 8.3.15.1830 dt в копию загружается без ошибок?
Кстати, на PostgreSQL и 8.3.17 бэкап залился без ошибок.
(0) на какой субд ?
(6) искать пробовал, а исправлять нет — я не админ. Статью админам показывал, результат тот же.
(0) dt это не бэкап. И многие это понимают слишком поздно.
(6) Вообще не в кассу.
(0) Обращаться нужно в поддержку.
Oracle Spatial
Сервер переехал на новый сайт http://www.oraclegis.com/blog. Здесь идет ретрансляция
пятница, 21 ноября 2008 г.
Ошибка ORA-01722: неверное число или ORA-01722: invalid number
Обычно ошибка возникает при загрузки данных из текстового файла с помощью Oracle Sqlloader. Ошибка связана с тем, что в России разделитель целой и дробной часть запятая, а в США и Европе – точка.
Если попытаться загрузить в базу некорректно отформатированные данные, то Oracle их не поймет. Выйти из этого положения можно несколькими способами. Некоторые проще, некоторые сложне. Давайте рассмотрим их. Вначале простые, к концу более сложные и, возможно, чреватые проблемами.
1. Зайти в файл и заменить все точки на запятые. Например
1|New York|NY|7322564|1|2001|8307|-73.943849000|40.669800000|
заменяем на
Тут всеп просто. Никаких подводных камней, кроме того, что точки могут встречаться не только в числах и это надо отслеживать, иначе испортите данные.
Например в Linux это легко сделать с помощью sed (для Windows можно взять отсюда или использовать, скажем, perl). Команда не создает резервной копии.
sed -i ‘s/\./,/g’ filename.txt
2. В локальном файле при загрузке данных установить соответствующие параметры NLS.
Например, если загрузка осуществляется следующим скриптом батником:
sqlldr scott/tiger@orcl control=us_cities\us_cities.ctl data=us_cities\us_cities.dat
то ошибки можно избежать с помощью выполнения предварительно в bat-файле вот такой команды:
set nls_lang=american_america.CL8MSWIN1251
sqlldr scott/tiger@orcl control=us_cities\us_cities.ctl data=us_cities\us_cities.dat
Я считаю этот вариант наиболее предпочтительным.
3. Если это Windows, то можно изменить глобальные настройки NLS. Сделать это можно в реестре в веточке
Нужно будет вместо значения RUSSIAN_RUSSIA.CL8MSWIN1251 прописать AMERICAN_AMERICA.CL8MSWIN1251.
Это решение может очень сильно повлиять на систему в целом. Действие этого параметра может повлечь неработоспособность другого приложения.
Ora 01722 неверное число как исправить
The ORA-01722 message is a fairly typical error in Oracle. It is an “invalid number” error, occurring during a failure when converting a character string to a valid number. While this type of error can be an easy fix, it can be caused by a multitude of numerical mistakes.
The first step in resolving this error is first keeping in mind what a valid number in Oracle represents. Valid numbers will contain the digits zero through nine, and can contain specific characters such as +/- at the beginning or end of the string, a single decimal point or an ‘E’ (upper or lower case) for floating point numbers in scientific notation. You should double check the character strings in the expression in question to make sure that the numbers follow these precise rules.
Practically speaking, there are several common and simple ways in which you could produce this error. If you attempt to add or subtract dates to or from string values, the result will produce ORA-01722 (such as in an expression ’06-JUL-15′ + ‘xyz’). This same idea applies when performing arithmetic functions on strings (for example, ‘xyz’ -571). Another mistake often seen is when the user inserts a comma instead of a decimal point in a numerical expression, due to their proximity on the keyboard. If a field is also filled with exclusively spaces, the error can be raised. By replacing the spaces with zeroes, the error can be resolved.
There are ways to fix this problem, with the first looking at an “INSERT INTO… VALUES (…)” attempt. Go through the steps above; check the data you are entering to make sure the numerical values are in line, and correct any that are invalid. In the event that all of the numbers are valid, the error possibly occurred from your columns being out of order (resulting in a VALUES string being placed into a NUMBER column, often deriving from removing or adding columns to a table).
Other situations can be more complex. In the event of using INSERT or UPDATE to supply values to a sub query, the ORA-01722 will be hidden. You will have to find the row that is supplying an invalid numerical string and resolve it. If instead of INSERT you attempt SELECT, the error will derive from an implicit conversion in the WHERE clause. Make sure numeric columns and character columns are not being compared, and be sure to exclude any rows not including valid numbers from the WHERE clause.
In the grand scheme of things, keeping aware of how numerical expressions and character strings will interact within your database is key to preventing errors like ORA-01722 from happening. It can be easy to get caught up in the tunnel vision that sometimes accompanies coding data programs, so keeping a meticulous eye out for when items likes dates and numerical expressions will converge on arithmetic functions can give you a cautious perspective that could save hours of frustration. Working with a dedicated Oracle consulting firm can provide you with the design elements and mindset necessary to avoid such mistakes in your management of an Oracle database.