Connor said: "A blob doesn't *have* a mime type - its just binary data."
But DBMS_LOB package has SETCONTENTTYPE and GETCONTENTTYPE that works with Securefile LOBs.
Apparently Securefile LOBs can have some metadata?
That's not
detecting mime type - but it could be a way to
store mime type on a LOB, right?
-
(
As an aside, I
thought this was used by SQL Developer for VS Code, because I tried this query:
select apex_barcode.get_qrcode_png(p_value=>'https://kibeha.dk',p_scale=>2) as qr_blob from dual;
And then in the output grid I right-click, go to Single Record View and click the three dots, which brings up details about the blob, where it states that the mime type is Image/PNG.
I
thought that probably apex_barcode was using SETCONTENTTYPE, so VS Code was showing the result of GETCONTENTTYPE, but then I tried:
select dbms_lob.getcontenttype(apex_barcode.get_qrcode_png(p_value=>'https://kibeha.dk',p_scale=>2)) as qr_blob_type from dual;
And that gives error:
ORA-43856: Unsupported LOB type for SECUREFILE LOB operation
ORA-06512: at "SYS.DBMS_LOB", line 2127
So I guess that means that the SQL Developer VS Code extension probably utilizes some way of detecting mime type from the content, as apparently it cannot use GETCONTENTTYPE.
)
Cheerio
/Kim
October 02, 2025 - 1:36 am UTC
Agreed, but this is just putting additional data into the binary data that is the "blob".
Fundamentally it is always going to come down to how a calling client can infer/utilise this information, and as you've seen, there's no guarantee that any client is going to "know" to go and get it