Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine size in kb of a BLOB column in DB2

Tags:

size

blob

db2

File table contains - File_Id and File_data(BLOB)

how can I know the size of the binary file stored in File_data column. length function gives the length of file but how to know the size in KB.

like image 859
nectar Avatar asked Mar 29 '12 09:03

nectar


People also ask

How do I check my blob size?

Run the SQL query Name your SQL query in the properties pane on the right. Publish your SQL query by pressing CTRL+S or selecting the Publish all button. Select the Run button to execute the SQL query. The blob count and total size per container are reported in the Results pane.

What is the size of the blob?

BLOB: Can handle up to 65,535 bytes of data. MEDIUMBLOB: The maximum length supported is 16,777,215 bytes. LONGBLOB: Stores up to 4,294,967,295 bytes of data.

How do you find the record length of a Db2 table?

The sum of each column's length is the record length , which is the length of data that is physically stored in the table. You can retrieve the value of the AVGROWLEN column in the SYSIBM. SYSTABLES catalog table to determine the average length of rows within a table.

What is a Db2 blob?

BLOB : Variable-length binary large object string that can be up to 2GB (2,147,483,647) long. Primarily intended to hold non-traditional data, such as voice or mixed media. BLOB strings are not associated with a character set, as with FOR BIT DATA strings.


1 Answers

This gives a number in bytes, devide it by 1024 to get size in KB.

Select sum(BIGINT(length(blob_column)))
from table;
like image 198
Ramazan Polat Avatar answered Sep 18 '22 23:09

Ramazan Polat