Maximum length for columns of SQL type varchar

fbergstrand
fbergstrand New Altair Community Member
edited November 2024 in Community Q&A

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

  • Edin_Klapic
    Edin_Klapic New Altair Community Member
    Answer ✓

    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,

    Edin

Answers

  • Thomas_Ott
    Thomas_Ott New Altair Community Member

    @BalazsBarany any idea?

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member

    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

  • fbergstrand
    fbergstrand New Altair Community Member

    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. 

  • Edin_Klapic
    Edin_Klapic New Altair Community Member
    Answer ✓

    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,

    Edin

  • fbergstrand
    fbergstrand New Altair Community Member

    Great, thanks this worked!


    @Edin_Klapic wrote:

    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,

    Edin