bibi92
asked on
ORA-01722: invalid number
Hello,
How can I resolve this problem?
SQL> select to_char(DAT,'YYYY MON DD HH24:MI:SS') datetime, sum(to_number(R_RPS)) R_RPS, sum(to_number(W_WPS)) W_WPS,
2 sum(to_number(Q_SQFULL)) SQLFULL
3 from TMP__IO
4 group by to_char(DAT,'YYYY MON DD HH24:MI:SS') ;
select to_char(DAT,'YYYY MON DD HH24:MI:SS') datetime, sum(to_number(R_RPS)) R_RPS, sum(to_number(W_WPS)) W_WPS,
*
ERREUR Ó la ligne 1 :
ORA-01722: invalid number
Thanks
bibi
How can I resolve this problem?
SQL> select to_char(DAT,'YYYY MON DD HH24:MI:SS') datetime, sum(to_number(R_RPS)) R_RPS, sum(to_number(W_WPS)) W_WPS,
2 sum(to_number(Q_SQFULL)) SQLFULL
3 from TMP__IO
4 group by to_char(DAT,'YYYY MON DD HH24:MI:SS') ;
select to_char(DAT,'YYYY MON DD HH24:MI:SS') datetime, sum(to_number(R_RPS)) R_RPS, sum(to_number(W_WPS)) W_WPS,
*
ERREUR Ó la ligne 1 :
ORA-01722: invalid number
Thanks
bibi
make sure that all the values in that column are realy number (no spaces and no other characters)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
values in the columns are varchar.
Thanks
bibi
Thanks
bibi
varchar yes, but they should contain only numbers stored as strings
ASKER
I have created the function but I have the same error.
using the function, you can find the problem:
select * from yourtable
where GetNumber2(yourfield) <> yourfield
ASKER
SQL> select * from TMP__IO
2 where GetNumber2(R_RPS) <> R_RPS
3 /
where GetNumber2(R_RPS) <> R_RPS
*
ERREUR Ó la ligne 2 :
ORA-01722: invalid number
Thanks
bibi
2 where GetNumber2(R_RPS) <> R_RPS
3 /
where GetNumber2(R_RPS) <> R_RPS
*
ERREUR Ó la ligne 2 :
ORA-01722: invalid number
Thanks
bibi
sorry:
select * from TMP__IO
where GetNumber2(R_RPS) IS NULL
select * from TMP__IO where not regexp_like(R_RPS, '[[:digit:]]+')
ASKER
SQL> select * from TMP__IO
2 where GetNumber2(R_RPS) is null
3 /
no row
ASKER
Thanks bibi