Search notes:

ORA-40491: invalid input data type for JSON_TABLE

This statement runs without error:
select
   x
from
  json_table('[1,2,3]', '$[*]'
  columns (
    x number path '$[*]'
  )
);
The following statement concatenates two strings and produces ORA-40491: invalid input data type for JSON_TABLE in Oracle 19c - but runs fine in 23c:
select
   x
from
  json_table('[1,2' || ',3]', '$[*]'
  columns (
     x number path '$[*]'
  )
);
Casting the concatenated string to a varchar2 allows to execute the statement in 19c also:
select
   x
from
  json_table(cast('[1,2' || ',3]' as varchar2(4000)), '$[*]'
  columns (
     x number path '$[*]'
  )
);
Interestingly, when the concatenation takes place in a subquery, the error is not thrown in 19c:
create table tq84_j (j varchar2(4000), k varchar2(4000));

insert into tq84_j values('1,2,3', '4,5,6');

select
   x
from
     json_table(
       (select '[' || j || ',' || k || ']' from tq84_j), '$[*]'
     columns (
        x number path '$[*]'
     )
);
 
drop   table tq84_j;

See also

Other Oracle error messages

Index