Maximum length for columns of SQL type varchar

fbergstrandfbergstrand MemberPosts:8Contributor I
edited December 2018 inHelp

Hi,

I've been running a couple of processes in Rapidminer in which I run my query to write database in MySQL.

I've been uploading quite a few datasets with no issues but experienced an error message I've never seen before.

"attribute page ref contains values with length> 255 which is the maximum length for columns of SQL type Varchar"

I'm using the write database operator and other files and processes are fine to upload. When I look at mySql table the attributes Page_ref is of datatype varchar(900). I've tried to both tick and untick the set dafault varchar lenght in the write database operator but it does not seem to make a difference.

Any ideas what is causing this error?

Tagged:

Best Answer

  • 艾丁_Klapic艾丁_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist
    Solution Accepted

    Hi,

    try using the Operator "Nominal to Text" and convert the relevant attributes to the value type Text. Then you do not run into issues if there will be entries longer than 900 characters in the future.

    Best,

    艾丁

    MartinLiebig

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    @BalazsBaranyany idea?

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified ExpertPosts:949Unicorn

    Hi,

    I tested it on a MySQL database (5.5.55) with RM Studio 7.4. Created a table with a VARCHAR(1200) column.

    Write Database was able to write long nominal values into the table without problems (even longer than 1200 characters - known misfeature of MySQL). I tested both MyISAM and InnoDB tables.

    What is your database version? Since MySQL 5.0.3 it is possible to have VARCHARs with more than 255 characters. However, there's an overall row size limit (65,535).

    Regards,

    Balázs

  • fbergstrandfbergstrand MemberPosts:8Contributor I

    Hi,

    My MySQL database is version 6.3.3.

    What's confusing is that I'm able to write very similiar processes without any issues.

  • fbergstrandfbergstrand MemberPosts:8Contributor I

    Great, thanks this worked!


    @Edin_Klapicwrote:

    Hi,

    try using the Operator "Nominal to Text" and convert the relevant attributes to the value type Text. Then you do not run into issues if there will be entries longer than 900 characters in the future.

    Best,

    艾丁


Sign InorRegisterto comment.