Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01722: invalid number

Rakesh119Aug 14 2020 — edited Aug 14 2020

I am checking string for a value after $ character and i want only those records where that character is numeric line number from 1 to 16 when executed gives me the desired result but when i add the line number 17 it gives me  ORA-01722: invalid number error,

Now for checking whether i am comparing a string with number i wrote line number 7 and 8 and no problems it gives me results so i am not comparing a string with number then why does line number 17 gives me a invalid number error

select

TASK_ID,

TAM.TOWER TOWER,

TASK_STATUS STATUS,

cast(TASK_ACTIVATE_TIME as timestamp) TASK_ACTIVATE_TIME,

CHANGE_SUMMARY

/*CASE WHEN substr(CHANGE_SUMMARY,INSTR(CHANGE_SUMMARY,'$')+1,1) <= 2 THEN 'Pass'

     WHEN substr(CHANGE_SUMMARY,INSTR(CHANGE_SUMMARY,'$')+1,1) > 2 THEN 'Fail'

END SERVER_COUNT*/

FROM   V_CHANGE_TASK_LIVE_MONITOR@NTT_QQITSMREP.BMW CTLM 

JOIN TOWER_ASSGNEE_MAPPING TAM on TAM.ASSIGNEE_GROUP_NAME = CTLM.TASK_ASSIGNEE_GROUP 

where TASK_STATUS <> 'Closed'

AND TASK_STATUS <> 'Staged'

AND TASK_NAME IN (select TASK_NAME from NON_PROVNG_DECOMNG_TASKS)

AND TAM.TOWER IN ('LINUX', 'WINDOWS')

AND TRIM(TRANSLATE(substr(CHANGE_SUMMARY,INSTR(CHANGE_SUMMARY,'$')+1,1), '0123456789-,.', ' ')) IS NULL

AND substr(CHANGE_SUMMARY,INSTR(CHANGE_SUMMARY,'$')+1,1) <= 2

Please advise.

Thanks

Rakesh

This post has been answered by Sven W. on Aug 14 2020
Jump to Answer
Comments
Post Details
Added on Aug 14 2020
7 comments
3,691 views