Data Type issue

Hello all,
I want to write my excel table to DB writer but I have an error “String or binary data would be truncated”. It means that in one of the cells(Varchar) there are more than 255 characters. Unfortunately, I cannot change Varchar to e.g Text, because Knime does not give me such option.
Can I do something here to have more than 255 characters in one cell?

Best,
Ram

hi @IMR2KA Are you creating a new table or updating an existing one?

@duristef
I update the existing one.
I renamed and deleted some columns, and want to put this table to the Database SQL

Maybe the target column in the DB is wide 255 char and the string from Knime is longer, so you have to modify the DB table, not the workflow

1 Like

@duristef,
you are right. But I do not where in DB Writer Node I can change it?

I suggest you modify the table structure using your db client, not Knime

@IMR2KA what is you database system. The syntax could be executed thru the SQL Executor but it will depend on your database system and the possible restrictions of you database table. Also you have to be aware that this changes will affect all unseres and processes accessing this table.

You could see how such operations work in general in this H2 database example.

1 Like

Hello all,

I found the solution. Instead of using DB Writer Node I used:

  1. DB Table Creator Node (here I can apply to my columns not only varchar(255) but also varchar(max))
  2. Plus DB Insert Node.
    image

Best,
Ram

2 Likes

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