[Building Sakai] truncating to fit field

Charles Hedrick hedrick at rutgers.edu
Thu Feb 27 08:29:49 PST 2014


I am generating a group name. The maximum length is 99 characters. In mysql it appears that truncating to 99 characters is fine, because mysql interprets field lengths in characters.

However in Oracle, unless the declaration uses “char”, it is understood to be bytes. That means that UTF-8 characters can take more than one space. Is there some standard method in Sakai to truncate a string to a length that will fit into a given database field?

Unfortunately, the SAKAI_SITE_GROUP is defined in oracle using field names without “char” after them.




More information about the sakai-dev mailing list