Finding size of files in BLOB datatype
I have a table named DOCUMENT with a BLOB datatype for storing files. I want a query to find the size of each file stored in that BLOB object.
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
SQL> desc scott.demo Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER(38) THEBLOB BLOB FILE_NAME VARCHAR2(50) CENTER_ID VARCHAR2(5) MIMI_TYPE VARCHAR2(20) THELONG LONG RAW SQL> l 1 select substr(file_name,1,20) Name, MIMI_TYPE, dbms_lob.GETLENGTH(theblob) 2* from scott.demo SQL> / NAME MIMI_TYPE DBMS_LOB.GETLENGTH(THEBLOB) -------------------- -------------------- --------------------------- Design and Construct application/pdf 682183 Lease Agreement - 18 application/pdf 2301417 Agreement in Princip application/pdf 353304 User Manual application/MSWORD 1089536 unknown Job Corps.bmp image/bmp 64062 01-New VST Retail Sa image/jpeg 89525 Agreement in Princip application/pdf 353304 Design and Construct application/pdf 682183 Lease Agreement - 18 application/pdf 2301417 10 rows selected. SQL> spool off;