AW: [odb-users] Storing files in an oracle database

Marcel Nehring mne at qosmotec.com
Mon Jan 18 10:14:09 EST 2016


Hi Boris,

as always your thoughts were very helpful and brought us closer to a working solution. Thanks for that!

> Ok, so it should be possible to provide proper support for BFILE in libodb-oracle. The dual mapping might be tricky though.

Would be cool to see that in a future version of ODB.

> And you can use such functions in 'db map' pragmas as shown in the oracle/custom test in the odb-tests package. It's possible this defeats the whole purpose of using BFILE in the first place. But it would be interesting to know if it actually works. Could you give it a try?
> What could works is encoding the file name as BLOB. Then you would write another function, blob_to_bfile(), except instead of the binary data blob will contain the file name.

I wasn't aware of the fact that it is possible to use custom functions with ODB. I tried that and got it working in principle. An initial insert of a new row and reading that row back again works. However, the problem are updates. Once the row is loaded and the corresponding class member contains binary data ODB uses these binary data in the update clause. That is why I tried to separate filename and binary data into two separate members. I would then need to use the filename member in INSERT and UPDATE queries and the binary member for SELECT. Since my tries with the get-pragma did not work you mentioned one could achieve this with sections. Unfortunately I don't see how, could you elaborate on this?

Regards,
Marcel



More information about the odb-users mailing list