I am reading contents of a file and adding it as a row in mysql db. The column in which the file contens will be added is a TEXT column.
There are multiple files that will be uploaded and it’s contents are extracted in a cronjob and added to the TEXT column. One row per file.
My files sometimes are empty. In that case, a row with no content is created.
Now, I need to retrieve this content in another cronjob and perform some activities. I would like to filter and retrieve only those rows where content exists. Like using where clause with LENGTH(TRIM(ContentCol)) > 0. Since it is a TEXT column, I am unable to use LENGTH & TRIM functions.
Also when I use LENGTH function, it show different length.. I could see 5, 1 etc. though there is no value in the row-cell.
How can I perform this criteria?
Well I use the function
BIT_LENGTH(string);but only with short text data.This function only return the length of bits, I evaluate this like