I have an odd scenario. On an oracle 11.2 db there is one value that when selected into a table type causes and invalid data type error when the table type is used. I have validated that when the row is excluded everything else works fine.
Pseudo code;
type my_nums is table of number;
select num bulk collect into my_nums from tableA;
select t.my_col from tableB t where t.my_col IN (select column_value from table(my_nums));
I have checked this one key from tableA is a numeric using;
with t as (select to_char(num) as txt from tableA where num = 33)
select txt, case when regexp_like(txt, '^-?[[:digit:],.]*$') then 'Numeric' else 'Non-Numeric' end as type
FROM t;
Taken from How to check if a field is numeric. Is there something else I can look at to find out why this is happening?
To be clear, using the following, all is well in my procedure.
select num bulk collect into my_nums from tableA where num != 33;
Thanks in advance.