Increase Text Length and Receiving Error

Hello,

In one of our mobile applications, we have a couple of text fields, where we ask the user to input certain details about their project. We started out with these fields having a length of 500, but realized we needed to increase this. We have increased the length of these text attributes to 2000. We have updated the server attributes, the local attributes, and the input field to allow 2000. After we publish, when we test, we are receiving the error "String or binary data would be truncated. The statement has been terminated". The text we are inputting to test is nowhere near 2000 characters, but it is over 500. We understand what this error is saying, but we have checked our fields over and over and all of our attributes and inputs are set to 2000. Why are we still seeing this error and what can we do to correct it?

Can you share a small sample that reproduces the issue as an OML?

I'm not able to reproduce the issue on OutSystems 11. Which version are you using?

Hey Kate,

A sample would help.  Just to confirm though, have you increased the field size in the database itself?  If stored in OutSystems, then by adjusting the Entity attribute, or if an external database then in the database and the extension.

Solution

Hi Kate,

Given the specific error message, I'm assuming the problem is in a Server Entity. Did you look at the error logging in Service Center? Did you debug to see what Entity Action gives that error? If the Text is less than 500, but all other data is the same, do you still get the error?*

*I recall a similar error we had, we stored a title + remark in the database, in the end it turned out to be the title, not the remark causing the problem :).

Solution

Hi Kate,

You increased the lengths of existing attributes.

Could you try to create a new a attribute with length 2000 and see if you get the same error?

Regards,

Daniel

@Daniël: that could something to try when everything else fails, but it seems to be she hasn't even checked SC and/or debugged, that would be the first thing to try!

@Kilian, fair enough, just trying to add some suggestion to find the route cause of the problem.

Hi,

I only could reproduce this error if I set the size of the attribute, in Server Storage, to a lower length than the one at Local Storage.

But as soon as I changed the size back to a compatible value, it started to work immediately. 

So, If you are using OutSystems 11, I would say that Killian probably has a point and you are looking to the wrong attribute.

If you are using OutSystems 10, probably is the same thing, but if not, you can see if refreshing dependencies can help.

Cheers.

Hi all,

We debugged and found we had not increased the length of text in our archive entity. Thank you for all your responses!

Kate

Thanks for the feedback Kate. Happy coding! :)