Error "Exception for source column 4 and target column 4" when executing a mapping
Symptom
A mapping which contains source columns with type "NVARCHAR" fails with an error similar to this one:
com.indy.engine.common.exceptions.EngineExceptionI: Exception for source column 4 and target column 4
at com.indy.engine.actionCodes.JdbcActionCodeI.a(SourceFile:596)
at com.indy.engine.actionCodes.JdbcActionCodeI.executeTrgDirectBindedInsert(SourceFile:665)
at com.indy.engine.actionCodes.JdbcActionCodeI.executeDirectBindedFetch(SourceFile:971)
at com.indy.engine.action.common.ActionCodeTypeI.executeDirectBindedCode(SourceFile:1399)
at com.indy.engine.action.common.ActionCodeTypeI.executeBindedCode(SourceFile:1565)
at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1630)
at com.indy.engine.action.common.ActionCodeTypeI.run(SourceFile:1805)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Method not supported with this server. : IfxPreparedStatement.setNString(int,String)
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:488)
at com.informix.jdbc.IfxPreparedStatement.setNString(IfxPreparedStatement.java:5477)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setNString(DelegatingPreparedStatement.java:238)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setNString(DelegatingPreparedStatement.java:238)
at com.indy.engine.actionCodes.convert.JdbcConverter.convertString(JdbcConverter.java:109)
at com.indy.engine.actionCodes.convert.JdbcConverter$4.write(JdbcConverter.java:662)
at com.indy.engine.actionCodes.convert.JdbcConverter$4.write(JdbcConverter.java:1)
at com.indy.engine.actionCodes.loader.a.a(SourceFile:113)
at com.indy.engine.actionCodes.JdbcActionCodeI.a(SourceFile:584
Solution
Some RDBMS technologies and some JDBC drivers do not support NVARCHAR conversions.
Within your workspace, you can set a JDBC option to avoid this kind of conversion:
- Edit the .md file of the target RDBMS technology
- On the root node (the server node), choose Advanced, and add the property "JDBC.BIND.MANAGE_SET_NSTRING_AS_STRING"
- Save the technology