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!

DISTINCT returns error on column with TO_NUMBER

bentonAug 27 2012 — edited Aug 27 2012
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

Hi

I have a query like this that works fine and returns x amount of records;
select to_number(col_3) plot_number
  from user_recovery_external;
I now want a distinct list of values so I add distinct like this and it now throws an error;
select distinct to_number(col_3) plot_number
  from user_recovery_external;

Error starting at line 15 in command:
select distinct to_number(col_3) plot_number
  from user_recovery_external
Error report:
SQL Error: ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-01722: invalid number
ORA-06512: at "SYS.ORACLE_LOADER", line 52
29913. 00000 -  "error in executing %s callout"
*Cause:    The execution of the specified callout caused an error.
*Action:   Examine the error messages take appropriate action.
What am I doing wrong?

Ben
This post has been answered by jeneesh on Aug 27 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2012
Added on Aug 27 2012
4 comments
1,548 views