cancel
Showing results for 
Search instead for 
Did you mean: 

Length restriction for data type in 1305

Former Member
0 Kudos

Hi

After a long time I started using ByD studio(1305), I have found some changes in defining datatype for elements

for few data type like NAME, TEXT, identifier it show one message as "Data type without length restriction shall not be used for query parameter"

I have not found any document for length restriction.

Is that means if I create a query overview for this BO,  then these parameter can't be used?

Your reply will be appreciated!!

Thanks:

Sunil

Accepted Solutions (0)

Answers (1)

Answers (1)

ReinholdK
Employee
Employee
0 Kudos

Hello,

the message is quite misleading. The database layer for business objects does not support elements longer than 255 characters. Even if you are using a data type that is longer than 255 (Name, Text, Identifier do not have a length restriction), the field created on the data base will be able to store up to 255 characters only. Storing a value that is longer than that will either cut-off the value or result in a runtime error. That's why the warning is raised.

We'll improve the message text.

Regards

-- Reinhold

Former Member
0 Kudos

I recall filling one text content of a file with huge data and attaching it to an Attachment Folder all through code.

Initially, I've faced this cut-off issue at 256th character as shown below...

If I am printing a two letter string "abcd" continuosly followed by a new line character...

while(true){ // ofcourse, I am not gonna loop it infinite

     print "abcd"+ "/r/n";

}

at some point the loop will be at its 255th character. Consider for that loop, the pointer is at 'b' of 'abcd'. In this case, 'cd' will be truncated.

But as the loop goes on, the next loop will print 'abcd' again..... in the below pattern

.

..

abcd

abcd

ab //256th character cut-off occured here

abcd

abcd

..

.

With time, I didn't even see this cut-off as well. Everything started coming properly without data being truncated. So, not to offend your answer Reinhold, I think there are few datatypes which can store more than 255 characters.

ReinholdK
Employee
Employee
0 Kudos

You are right, embedding a dependent object (AttachmentFolder or TextCollection) is the way to store data longer than 255 characters in a business object. The restriction to 255 characters applies to the element declaration and is independent of the data type:

businessobject LongTexts {

    element LimitedText255 : LANGUAGEINDEPENDENT_Text; // or any other unrestricted type, e.g. Name, Identifier, Note, ...     [DependentObject(TextCollection)]     node CapableToStoreLongTexts; }

Regards

-- Reinhold