Questions tagged [longtext]

143 questions
35
votes
4 answers

Limit length of longtext field in SELECT results

I'm executing a SELECT query on a table in MySQL using the command-line interface (not a GUI client): SELECT * FROM blog_entry; One of blog_entry's fields is of type 'longtext' and is such a long piece of text that when the result is displayed in…
maxm
  • 5,161
  • 7
  • 30
  • 33
34
votes
2 answers

What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field?

What is the disadvantage to using a MySQL longtext sized field when every entry will fit within a mediumtext sized field? The reason I am asking is because I have some longtext sized fields and recently realized they are much too large, but then…
darkAsPitch
  • 1,855
  • 4
  • 23
  • 35
24
votes
10 answers

JPA: "Data too long for column" does not change

One of my entities Machinery has got a String property called notes. JPA 2-Hibernate generates the schema for me, in my case the RDBMS is a MySQL. notes is created as a VARCHAR(255) column, which is right. Users begin to create records and all works…
Fabio B.
  • 9,138
  • 25
  • 105
  • 177
22
votes
5 answers

Output array in Twig

I trying to output an array from the database to the screen. In my entity: /** * @ORM\Column(type="array", nullable=true) */ private $category; In my twig template: {% for category in user.profile.category %} {{ category }} {% endfor…
nowiko
  • 2,507
  • 6
  • 38
  • 82
14
votes
3 answers

Translating longer texts (view and email templates) with gettext

I'm developing a multilingual PHP web application, and I've got long(-ish) texts that I need to translate with gettext. These are email templates (usually short, but still several lines) and parts of view templates (longer descriptive blocks of…
lanzz
  • 42,060
  • 10
  • 89
  • 98
14
votes
6 answers

EditText ellipsize (three dots...)

Unfortunatelly I am not able to make ellipsize for EditText works. Is even possible to put three dots at the end of the text when the text is too long? It is working perfectly for TextiView but not for EditText. Some idea? …
AdaMoOo
  • 427
  • 2
  • 5
  • 12
13
votes
4 answers

How to handle long text in preferences on Android?

Background I'm making an app that has some settings, and I want to use the built in PreferenceActivity or PreferenceFragment for the job The problem Some of the preferences have a long title which I cannot shorten, plus I think that if I ever…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
12
votes
3 answers

SQL Error 1406 Data too long for column

I am trying to execute the query below in MySQL but get the SQL error 1406 Data too long for column error every time. The column data type is longtext. Any ideas? UPDATE `my_db`.`my_table` SET `content` = '
Frank Martin
  • 1,611
  • 1
  • 14
  • 18
11
votes
5 answers

BLOB/TEXT column 'bestilling' used in key specification without a key length

I am trying to make a order system, but I am stuck right now. In the mysql tabel right now, I am using varchar(255) in a column named "bestillinger", but it can only store 255 chars. So I searched a bit, and remembered that i could use longtext or…
Ismail
  • 253
  • 1
  • 4
  • 19
7
votes
1 answer

Prepared mysqli select statement on longtext field is coming back empty

I've got a database query function that works well -- except that I'm running into what's apparently a known issue with mysqli prepared statements and longtext fields. What happens is that the longtext field always comes up empty even though…
Sean Cunningham
  • 3,006
  • 5
  • 24
  • 35
5
votes
3 answers

How to apply ROW_FORMAT=DYNAMIC to an existing table

I have a table with a large number of longtext fields (18) along with a number of other various integer and varchar fields. Recently a number of additional longtext fields were added, and have suddenly forced me to learn all about 8K row size…
DanH
  • 5,498
  • 4
  • 49
  • 72
5
votes
1 answer

GROUP_CONCAT and Longtext

I need to combine two text fields in the MySQL Database table into One, So I have used the Following SQL script to do it. Table: tbl_newsitems Combine: Need to combine the text in the 'ni_text' with the same 'news_id' Table Layout: Code used to…
lbo
  • 51
  • 1
  • 2
5
votes
1 answer

Memory consumption of having a column LONGTEXT in MySQL database

I'm creating a log table in my MySQL database. One of the field will be only used in approximately 5% of the logs and will contains stack traces and others lengthy informations for the developers. I was considering using the LONGTEXT field but I was…
Jean-François Côté
  • 4,200
  • 11
  • 52
  • 88
5
votes
2 answers

MySQL - LONGTEXT field causes hang in SELECT-WHERE statement

I am having an issue due to LONGTEXT field. Everything works fine, but when a SELECT query is executed with any WHERE clause in it, the mysql goes to sleep and never returns. There are only 80k records and explicit WHERE comparison works fine. (Some…
Raheel Hasan
  • 5,753
  • 4
  • 39
  • 70
4
votes
1 answer

JPA native query for LONGTEXT field in a MySQL view results in error

I have the following JPA SqlResultSetMapping: @SqlResultSetMappings({ @SqlResultSetMapping(name="GroupParticipantDTO", columns={ @ColumnResult(name="gpId"), …
kosoant
  • 11,619
  • 7
  • 31
  • 37
1
2 3
9 10