218
Views
4
Comments
Solved
Reduction of attribute length
Question

Hi everyone,

What is the expected behavior if I reduce the length of an attribute?

Let's say I have an attribute called 'Name' which has length 70 chars. If I now change the length of the attribute to 60 characters, what will happen to all the names with a length of more than 60 characters?  

Thanks in advance!

Wietse 

2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

Hi Wietse,

The platform won't let you do it if you have data that will be truncated:

UserImage.jpg
Wietse Jeuris

Afonso Carvalho wrote:

Hi Wietse,

The platform won't let you do it if you have data that will be truncated:

Hi Afonso,
Thank you for the quick response. We will be using a work around then! 


Wietse

2018-10-17 18-00-19
Carlos Gonçalves

To do this first you need to make sure all data have less chars than the number you are changing or that the entity is empty.

If you need to truncate everything you can use the snipet below

update {TAble} set {TAble}.[Name] = substring({TAble}.[Name],1,60)


UserImage.jpg
Wietse Jeuris

Carlos Gonçalves wrote:

To do this first you need to make sure all data have less chars than the number you are changing or that the entity is empty.

If you need to truncate everything you can use the snipet below

update {TAble} set {TAble}.[Name] = substring({TAble}.[Name],1,60)


Hi Carlos,

knowing that OutSystems otherwise truncates the data it is indeed correct that all data should be changed first. Thank you for your answer! 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.