Перейти к содержимому

Ora 01722 неверное число как исправить

  • автор:

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.

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) Обращаться нужно в поддержку.

ORA-01722: invalid number

Добрый день всем. Совсем не вижу, где я число некорректно написал. Помогите найти ошибку в sql скрипте, пожалуйста. P.S.: ошибку выдает без указания неправильной строки или еще чего. Если кто то спросит.

select distinct 'childal', child.id, child.municid, dateend, (select ADOPTACCESSPACKAGE.getrealchildfio(child.id, child.municid, 1)from dual) as ФИО, (select ADOPTACCESSPACKAGE.GETREALCHILDBIRTHDAY(child.id, child.municid, 1)from dual) as Дата_рождения, coalesce( (select t.ustr from (select q.ustr, q.datebegin, q.childid, q.municid from (select childid, municid, 'Опека' as ustr, dateend, datebegin from guardian where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Предварительная опека' as ustr, dateend, datebegin from prevguardian where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Приёмная семья' as ustr, dateend, datebegin from foster where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Усыновление' as ustr, dateend, datebegin from adopt where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Патронат' as ustr, dateend, datebegin from patronat where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Учреждения для детей-сирот и детей оставшихся б/п' as ustr, dateend, datebegin from internat where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Учреждения временного содержания' as ustr, dateend, datebegin from temporaryhouse where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) union select childid, municid, 'Патронаж' as ustr, dateend, datebegin from patronag where datebegin is not null and (dateend is null or dateend is not null and to_date(dateend,'dd.mm.yyyy')>sysdate) )q order by to_date(q.datebegin,'dd.mm.yyyy')desc )t inner join child on t.childid = child.id where rownum 1 and child.municid in ('', '') order by 5 asc; 

Отслеживать
задан 9 авг 2017 в 12:32
Vladislav Kuznetsov Vladislav Kuznetsov
439 6 6 серебряных знаков 19 19 бронзовых знаков

У вас есть много сравнений дат. Возможно там где то в поле лежит не дата и не получается сделать to_date . То есть с точки зрения синтаксиса запрос скорее всего написан правильно и ошибка выскакивает при его выполнении.

9 авг 2017 в 12:36
@Denis В оракле алиасы для выборок не обязательны, если к ним нет обращений.
9 авг 2017 в 12:42

А так ошибка может быть где угодно. даже например в child.param <> 1 если после param в БД символьное и в какой от записи попавшей под выборку в этом поле лежит не число. не видя структуры ваших таблц и данных что то конкретное посоветовать невозможно

9 авг 2017 в 12:43

Разбейте ваш запрос на части и выполняйте их. Метод половинного деления всегда помогает в подобных ситуациях

9 авг 2017 в 12:51

Ваша ошибка может возникнуть в любом месте, где происходит явное или не явное преобразование типов. Фактически в любом месте, где вы написали <колонка>условие <колонка>. Как уже говорил Mike, глядя на ваш запрос не возможно идентифицировать ошибку не видя структур таблиц..

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *