Problem writing data to Sybase


I have been succesfully using a JDBC driver for Sybase for a while to read data.
However, writing data results in an error.

Error while adding row #(Row0), reason: JZ0SA: Prepared Statement: Input parameter not set, index: 0.

I enabled the JDBC logging in the Advanced section of the Database connection and checked the log file.
The result is:

2019-10-11 14:49:21,401 : ERROR : KNIME-Worker-28 : : Node : DB Writer : 0:105 : Execute failed: Error while adding row #(Row0), reason: JZ0SA: Prepared Statement: Input parameter not set, index: 0.
java.sql.SQLException: Error while adding row #(Row0), reason: JZ0SA: Prepared Statement: Input parameter not set, index: 0.
at org.knime.database.agent.writer.impl.DefaultDatabaseWriterExecutor.handleErrors(
at org.knime.database.agent.writer.impl.DefaultDatabaseWriterExecutor.executeInSingleMode(
at org.knime.database.agent.writer.impl.DefaultDatabaseWriterExecutor.execute(
at org.knime.database.agent.writer.impl.DefaultDBWriter.insert(
at org.knime.core.node.NodeModel.executeModel(
at org.knime.core.node.Node.invokeFullyNodeModelExecute(
at org.knime.core.node.Node.execute(
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(
at org.knime.core.util.ThreadUtils$
at java.util.concurrent.Executors$
at org.knime.core.util.ThreadPool$
at org.knime.core.util.ThreadPool$
Caused by: java.sql.SQLException: JZ0SA: Prepared Statement: Input parameter not set, index: 0.
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.sendQuery(Unknown Source)
at com.sybase.jdbc4.jdbc.SybPreparedStatement.sendQuery(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.executeUpdate(Unknown Source)
at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
at org.knime.database.connection.impl.AbstractPreparedStatementWrapper.executeUpdate(
at org.knime.database.connection.impl.AbstractPreparedStatementWrapper.executeUpdate(
at org.knime.database.connection.impl.logged.LoggedPreparedStatement.executeUpdate(
at org.knime.database.connection.impl.AbstractPreparedStatementWrapper.executeUpdate(
at org.knime.database.connection.impl.monitored.MonitoredPreparedStatement.executeUpdate(
at org.knime.database.agent.writer.impl.DefaultDatabaseWriterExecutor.executeInSingleMode(
… 21 more

One of the problems might be the database dialect (I do not know how to get the SybaseDialect or SybaseAnywhereDialect)
Does anyone know a solution on how to write a table to Sybase IQ?
Thanks in advance

Hello marijn,

this looks like a problem with the driver which seems to use 0-based indices when using batch insertion whereas the JDBC specification uses 1-based indices. For an example see documentation of the parameterIndex for the setString() method. For more details see this bug ticket. I couldn’t find any documentation about this so please ask the Sybase support for further details on this problem.

Since all manipulation nodes use prepared statements and batch execution for performance reasons the only workaround you can use to write data is to compose an “insert into” statement with the values hard coded into the statement and then executing each statement with the DB SQL Executor node.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.