What are BLOB subtypes?
Blobs can store infinite amounts of data. They can be used to store text, images, videos, audio, or any other kind of data. Retrieving and writing data to blobs is done with separate functions, so it is usable to have some basic string (CHAR, VARCHAR) operations available for textual blob. Therefore the sub types were added (as blob is a type). The subtypes are:
0 - binary data (image, video, audio, whatever)
1 - text (basic character functions work)
2 - BLR (used for definitions of Firebird procedures, triggers, etc.)
User applications should only use subtypes 0 and 1.
Since Firebird 2.1 you can use the following builtin string manipulation functions on text (subtype 1) blobs: LEFT, RIGHT, SUBSTRING, TRIM, CHAR_LENGTH, REPLACE, TRIM, LPAD, RPAD.
Please note that most these functions load entire blob contents into memory, so make sure your server has enough RAM to store the data. If you need to know for sure, look at the function description in Firebird manual.
Some UDF function libraries built before Firebird 2.1 use the same function names (LEFT, TRIM, etc.) and those would override internal functions. The functions in those libraries do not support blobs. So, if you find that some of the functions does not work with your text blobs, check whether there is an UDF defined with the same name. To fix this problem, you can drop the UDF function are declare it again with a different name.