Error when connector insert many values into SQLServer database

1
0
-1

Hello!

I executed this SQL and the insert worked fine, but when I used in a bonita connector the following log error occured:

The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 225,
connectorDefinitionName = [conector_insert] failed. The failure will be handled.
2016-06-23 11:59:51 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork 
org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: 
org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: 
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'INSERT INTO table (column_1, column_2) VALUES (30,1700), (80,1700)'."

I can't find the failure in the insert, please can anyone help me?

Insert into a SQL Server 2012 table throw the bonita connector sqljdbc4.jar

Any help will be welcomed!

Thanks in advance!
Fa

Comments

Submitted by Sean McP on Fri, 06/24/2016 - 07:35

Did you try running individual statements?

  1. INSERT INTO table (column_1, column_2) VALUES (30,1700);
  2. INSERT INTO table (column_1, column_2) VALUES (80,1700)

does that work?

Submitted by Fabi13 on Fri, 06/24/2016 - 12:46
1 answer

1
0
-1
This one is the BEST answer!

Hi Sean,

I solved the problem: in separated script tasks. Yes, many "inserts" in a connector works in bonita :o)

I created:

script_one: string "INSERT" with "INSERT INTO table (column_1, column_2) VALUES "
script_two: string "VALUES" with the dynamic values to insert, in this case: "(80,1700), (90,1700), (70,1700)"
script_tree: string "QUERY" to join "INSERT" and "VALUES": INSERT INTO table (column_1, column_2) VALUES (80,1700), (90,1700), (70,1700)
script_four: connector with the string "${QUERY}" in the batch field.

Thanks!
Fa

Notifications