8

Is there a way to retrieve (using a select statement) the size of a blob field in Firebird??

I've a field called "data" and I'd like to know the total size of all the records in the table.

Thanks.

2 Answers 2

13

I think you can use the OCTET_LENGTH() function.

You should also look at this answer it should be helpful.

2

If the field contains Images or another kind of data or even Text, you can use F_BLOBSIZE(blobfield) from FreeAdHocUDF

Input BLOB TextBLOb For TextBLOb: returns the size/length (similar F_STRINGLENGTH) For BinarBLOb: returns the size of file in byte

2
  • What is better F_BLOBSIZE or OCTET_LENGTH?
    – hellboy
    Oct 10, 2013 at 11:31
  • @hellboy: OCTET_LENGTH for Firebird 2.1 and up, F_BLOBSIZE for Firebird 2.0 and below. See the Firebird documentation for more details Dec 31, 2015 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.