Being unreasonable (Bug in PL/SQL Web Services)
Nov 13th 2008vesterliJDeveloper
If you have a lot of PL/SQL packages, it should be real easy to publish them as Web Services - after all, JDeveloper contains a nice wizard for exactly this purpose.
I expected that a lot of people were already using this functionality, so I was very surprised to find a fairly trivial bug in the code built by JDeveloper. I found it reasonable enough to have a stored procedure taking a PL/SQL VARCHAR2 collection as input and calling it with non-ascii characters in the collection elements, but my application server disagreed. The message was ORA-01460: unimplemented or unreasonable conversion requested.
After some investigation, we found that this is caused by defective code built by the JDeveloper wizard. It builds a call to OracleCallableStatement.setPlsqlIndexTable() where the last parameter (elemMaxLen) is set to zero. This is a request for the JDBC driver to automatically figure out the max length - but it doesn’t work. You can fix it by manually changing the zero to a large value like 4000.
Oracle has registered this issue as bug 7503269.