ORA-01722: número inválido
Identify which line triggers the ORA-01722 error
Personal, I have a very large +/- 300 lines sql and in some line triggers the error (running from within the PL / SQL Developer):
only that does not specify in which line is the error. How can we know that? It's complicated to find the error without the line.
-
edson.amorim
- Rank: Analista Sênior

- Posts: 135
- Joined: Thu, 04 Oct 2007 3:36 pm
- Location: Belo Horizonte - MG
Dear colleague,
Go back to the code and see where the cursor is !!
Alé is the error,
Sincerely,
Go back to the code and see where the cursor is !!
Alé is the error,
Sincerely,
-
Trevisolli
- Moderador

- Posts: 2016
- Joined: Wed, 12 Jan 2005 3:25 pm
- Location: Araraquara - SP
Abraço,
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Brother,
a tip (I think the solution has to be found "in the hand" even) ...
Remove all the lines of your "SELECT" and go back one to a ...
Whatever, we are there.
a tip (I think the solution has to be found "in the hand" even) ...
Remove all the lines of your "SELECT" and go back one to a ...
Whatever, we are there.
I have a strange problem in a Select with Union All. Select is like this below:
The fact is that the field1 and field3 fields return the data normally and field2 always returns zero, and if I run SELECT separately It returns value. Am I doing something wrong at Union All?
select campo1
campo2
campo3
from(
select 0 campo1
campo2
0 campo3
from tabela2
union all
select campo1
0 campo2
0 campo3
from tabela1
union all
elect 0 campo1
0 campo2
campo3
from tabela3
)
-
margaridi
- Rank: Programador Júnior

- Posts: 21
- Joined: Tue, 08 Apr 2008 11:09 am
- Location: Curitiba - PR
- Contact:
Create a debug variable and update it at various points of the program (for example, in lines 50, 100, 150, 200, 250 and 300).
Print your result in the treatment of exception.
If the result indicates the number 150 is because the error is happening between line 150 and 200.
You can go upgrading the variable in more points within this range until you find the specific line.
Print your result in the treatment of exception.
If the result indicates the number 150 is because the error is happening between line 150 and 200.
You can go upgrading the variable in more points within this range until you find the specific line.
DECLARE
vDebug NUMBER(03);
BEGIN
COMANDO;
vDebug:=1;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
vDebug:=2;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
vDebug:=3;
COMANDO;
COMANDO;
COMANDO;
COMANDO;
EXCEPTION
When others then
dbms_output.put_line('Putz ... deu pau ! ... ' || '[' || to_char(vDebug) || ']', substr(sqlerrm,1,150));
raise_application_error(-20999,'Putz ... deu pau ! ... ' || '[' || to_char(vDebug) || ']'||substr(sqlerrm,1,150));
END;
-
- Information
-
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest


