The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Maximum length for columns of SQL type varchar

fbergstrandfbergstrand Member Posts: 8 Contributor I
edited November 2018 in Help

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_KlapicEdin_Klapic Employee-RapidMiner, RMResearcher, Member Posts: 299 RM 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,

    Edin

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    @BalazsBarany any idea?

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn

    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 Member Posts: 8 Contributor 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 Member Posts: 8 Contributor I

    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


     

Sign In or Register to comment.