Writing using DB Writer to HANA

I am trying to write data to SAP HANA using DB writer.
But, I get the following error - [#1, SQL-274] inserted value too large for column.

The reason is that we have limited the maximum field length in HANA. Is there any node that I can use where I can specify the maximum field length I can restrict in each column before I write to SAP HANA,

Appreciate your help,

Thank you,

Best Regards,

you can use a string manipulation node with this formula:

substr([field name], 0, (max length allowed))

Just change the field name and a number and you should be able to write correctly in you db.


1 Like

Hi Luca,

Thanks. I have tried using substr, but still not been able to solve the problem and I get the same error
I am trying to write into the database using NVARCHAR which is the type already specified in SAP DB. Though I am able to specify VARCHAR in the DB writer, I do not find a place where I can specify the character limit for each column.

A little background on this, Alteryx was used to update a SAP HANA table on which a calculation view is built. Now I have made the workflow in Knime where I am trying the replicate the same steps that was used in Alteryx.

Maybe you have to change column spec of db table?
In db writer you shouln’t be able to alter the destination table, right?

Hi Lucas,

That is also one approach we are looking at changing the specification in the DB itself instead. I think the specification was defined keeping in mind the performance.

It would be good to have a option to configure maximum length of the column in Knime similar to one available in Alteryx…:slight_smile:

Thanks for the feedback! Let me ask internally about this one.

1 Like

Hi @DeepakSBangera,

Have you tried to change the type mapping for the columns to NVARCHAR via the Output Type Mapping tab?

Regarding the columns you need to do some processing so that each column contains values not exceeding the maximum field length.

Hope this helps!

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