I am trying to create a variable column using mybatis pivot xml. It is like the example below.
However, if the string “[” is included, as in the example below, an error occurs.
Caused by: java.lang.NumberFormatException: For input string: “test] It is Test1”
Mybatis
SELECT *
FROM (SELECT job
, deptno
, sal
FROM emp
)
PIVOT ( SUM(sal)
FOR deptno IN (‘[test] It is Test1′,'[test] It is Test2′,'[test] It is Test3’)
)
ORDER BY job
Works without problem in Oracle DB tools
The phenomenon only occurs within queries within Mybatis.
임영광 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.