I have an issue with Large Object support in DBI. I am trying to create a Large Object abstraction class for the three databases supported by an application of mine.
See attached file for the current code. ( I'm only partway completed ). A variant of this currently works, and is used to stream large objects out of an Oracle database directly to the browser. ( File downloading from a database without having to cache the LOB in memory first. My problem is that DBI seems to want to "help" you to deal with LOB data. At least in Oracle, you are required to fetch the row, which will give you "part" of the binary data ( defined by $dbh->{LongReadLen} ), and you then have to use the $sth->blob_read method to read in chunks of the BLOB. Now, this is a little too much help for me. Oracle itself just has a LOB data type, you pull the record, get the object id, and pull that object id directly. It there any way of getting directly at these object id's rather than treating everything as rows? Before anyone comments, having to define the maximum memory size for the request, and having it automatically pull the data is a terrible ( in my opinion ) way to deal with non-trivial LOB data ( over, say, 10meg ). What options do I have? Bear in mind I have a working solution at the moment ( at least for pulling LOB data OUT of Oracle ), but I'd like something a bit more elegant. Thanks Adam
LOB.pm
Description: Binary data