sbrbot
sbrbot

Reputation: 6447

ORA-01722 when trying to use ORDER BY

I've got the following simple SQL query which returns data fine:

select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)

When I want to sort it with:

select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)
order by ticket_id

I get the error message:

ORA-01722: invalid number
01722. 00000 -  "invalid number"
*Cause:    The specified number was invalid.
*Action:   Specify a valid number.

How that can be!?

Upvotes: 1

Views: 2576

Answers (1)

Sudipta Mondal
Sudipta Mondal

Reputation: 2572

Just give the numbers as strings. Some of the values in executor_id cannot be converted to number and hence you are getting the error.

select ticket_id,executor_id
from e2efr
where executor_id in ('60882','91279')
order by ticket_id

Upvotes: 1

Related Questions