# Data too long for column at row

**URL:** <https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587>\
**Category:** Ignition\
**Tags:** ignition81, database, perspective\
**Created:** [May 15, 2022, 11:37pm UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587 "2022-05-15T23:37:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![csilk](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@csilk](https://forum.inductiveautomation.com/u/csilk)\
**Post date:** [May 15, 2022, 11:37pm UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587/1 "2022-05-15T23:37:52Z")

</div>

I have a field called “Service Details” that a user enters in information. There are several other fields that the user has to enter information into. Once all the necessary fields have the required information, I have a query that writes that data into a table. I keep getting an error saying, “Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column ‘serviceDetails’ at row 1”. I tried to just increase the size of that column, but still am receiving the error. I have a feeling that I need to change the datatype of ‘serviceDetails’. Currently, the datatype is VARCHAR, but I am not sure how to change that to something like VARCHAR(1000). Any insight would be appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [May 16, 2022, 12:16am UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587/2 "2022-05-16T00:16:29Z")

</div>

Do you have MYSql workbench installed? You can make the change with the GUI, by selecting your table \> right click \> alter table.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/43956081d9bbb40c683a2c9623fac58aaf41c1e8.png)

You may want to look into the TEXT, MEDIUMTEXT, and LONGTEXT data types, depending on how much might go into your text fields.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 16, 2022, 12:29pm UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587/3 "2022-05-16T12:29:48Z")

</div>

`alter table` will do it.  
Something like this I think (maybe check google to make sure :D)

```sql
ALTER TABLE table_name MODIFY column_name VARCHAR(1000)

```

---

<div class="post-metadata">

**Author:** ![csilk](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@csilk](https://forum.inductiveautomation.com/u/csilk)\
**Post date:** [May 16, 2022, 1:59pm UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587/4 "2022-05-16T13:59:20Z")

</div>

I tried that and received the following error:

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ALTER TABLE Reports MODIFY serviceDetails VARCHAR(1000)’ at line 9

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 16, 2022, 2:19pm UTC](https://forum.inductiveautomation.com/t/data-too-long-for-column-at-row/59587/5 "2022-05-16T14:19:53Z")

</div>

> [@pascal.fragnoud](#):
>
> (maybe check google to make sure :D)

[https://dev.mysql.com/doc/refman/8.0/en/alter-table.html](https://dev.mysql.com/doc/refman/8.0/en/alter-table.html)

And make sure to check the documentation for the version you're using.
