Subject Re: [ib-support] Order by and BLOB field
Author Paul Reeves
szsani wrote:
> Hi all
> I'd like to store texts in blob. But Order by My_Blob_field doesn't
> work well, and I can't find what is the matter.

If you run your query in ISQL you will see what is happening - the results are
ordered by blod_id, not the content of the blob.

It is arguable that order by should fail, or ignore the column if it is a
blob. After all, blobs can store any kind of data, thus rendering order by
quite meaningless for non-text blobs.

In any case, you can't index blobs, so your order by could be painfully slow
if a large result was returned. Perhaps you could store the first eighty chars
in a varchar field, index it, and order by column instead?

Paul Reeves
taking InterBase further