Is there a way of storing contents of a file in a database by using anything other than CLOB?
For a project, I want to store the contents of my file in a database.
I am aware that using CLOB is one of the options for storing large file contents. But I have heard that it is not开发者_StackOverflow社区 an efficient way to do so.
Are there other alternatives.
Thank you for your answers.
CLOBs are inefficient because every access returns the entire contents of the field, and every modification rewrites the entire contents of the field. It also makes searching on the data difficult and inefficient. If you can break the data up into smaller units to save in multiple rows in a table, that can lead to better, more efficient programs.
That said, those inefficiencies come from misusing the feature. It sounds like what you have in mind is probably just fine (provided, as you say, that you can't know where the file will end up getting stored; typically in this case what I would do would be to store a path to the file in the database rather than the contents of the file itself).
精彩评论