Error: Blobs are not allowed in this expression

Asked By 210 points N/A Posted on -
qa-featured

Hello everybody,

I need your help. I have one table called big _strings, and I created it using the following code:

Create table big_strings (Field_name text)

Then I wrote the following SQL Query:

Select subset (field_name, 1, 3) from big_strings;

But I get an error:

Error: Blobs are not allowed in this expression

Is there another way to select one part of a string in text field?

Thanks.

SHARE
Answered By 0 points N/A #84921

Error: Blobs are not allowed in this expression

qa-featured

A blob means "Binary Large Object" and a field with a TEXT type is actually a blob. You are trying to search for strings inside a text type which is not actually possible. If you want to search on a particular field, change the date type of the field to either CHAR or VARCHAR, whichever is more appropriate.

But if you really need a field with a TEXT data type, what you can do is create another field of CHAR OR VARCHAR type and then put the searchable keys (such as name, address, etc.) in that field instead so you can easily search for the content by just a plain Select statement. 

Related Questions