ReplicaDB icon indicating copy to clipboard operation
ReplicaDB copied to clipboard

mysql - mssql

Open davegartside opened this issue 1 year ago • 3 comments

Hello, trying to sync an INT column between mysql and mssql.

I get:

2024-04-23 10:54:27,451 ERROR ReplicaTask:69 ERROR in TaskId-0 inserting data to sink table: [An error occurred while converting the Long value to JDBC data type INTEGER., class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap

varchar works as expected

ReplicaDB-0.15.1-no-oracle.zip Ubuntu 22.04.3 LTS openjdk version "11.0.22" 2024-01-16 OpenJDK Runtime Environment (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1) OpenJDK 64-Bit Server VM (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1, mixed mode, sharing)

Any help gratefully recieved. Thanks.

davegartside avatar Apr 23 '24 10:04 davegartside

Hey @davegartside what is the Column Type of MySQL and MSSQL?

Have you tried to convert the source column to string and transfer it to the sink INT column?

MichalisDBA avatar Apr 23 '24 10:04 MichalisDBA

both column types are int converting it by doing this

source.query=SELECT convert(id,char) FROM glpi_computers

fixes it but feels wrong given they are both the same datatypes...

davegartside avatar Apr 23 '24 11:04 davegartside

I have done something similar from MSSQL to Oracle. As long as the sink Data are correct nothing to worry. I don't know the internal mechanics of jdbc. Maybe @osalvador has an answer to that.

MichalisDBA avatar Apr 23 '24 11:04 MichalisDBA