I am looking for a real good explanation of a BLOB and CLOB data. I am looking for the great of that explains in plain English.
问题:
回答1:
BLOB's (Binary Large OBject) store binary files: pictures, text, audio files, word documents, etc. Anything you can't read with the human eye. You can't select them via SQL*Plus.
CLOB's (Character Large OBjects) store character data. They are often used to store XML docs, JSON's or just large blocks of formatted or unformatted text.
回答2:
It's pretty straight forward. The difference is that your storing large data objects within the table as a column that are either character based (i.e. A CLOB) or binary based (i.e. a BLOB) Think of it in the same terms of how you would open a file as text vs when you open it as binary data.
VARCHARS etc. would still be preferred for string data types that are relatively short and in my mind a singular piece of data. For example a name, a street name, dept name etc. When you're looking to store something along the lines of a XML configuration file or the like, you would want to consider storing it as a CLOB. If you're storing say images, then a BLOB would be the logical choice. There are discussions about whether it's better to store the actual image or config file within the table vs storing a path to the actual file instead but I'll leave that for another question.
回答3:
A BLOB is a Binary Large Object which can hold anything you want including images and media files. Anything stored as a binary file.
A CLOB is a Charactor Large Object, which will hold charactors (text), Basically this makes it a huge string field. CLOB also supports charactor encoding meaning it is not just ascii charactors.
The two links to Oracle's FAQ will provide specific information for the usage of each.
回答4:
The Oracle Concepts Guide is the best source for an explanation of LOB datatypes. make sure you read the concepts guide at least once a year and the concept guide specific to the version of oracle you have. Every time I read it I learn something new.
Select * from v$version