Need a replacement data type in Oracle

I have a couple of tables in a database that are using the LONG data type. It's a horrible data type and we need to get rid of it. The question is what do I replace it with? I've narrowed it down to LOB, BLOB, or CLOB but the differences between those seem subtle and I can't quite figure out which is the best choice and why. Some of the LONG fields are storing bitmap image data. Others are storing HTML markup text. I'm OK with using a different data type for each of those. I just need to get rid of the LONG.
LVL 20
Russ SuterAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
johnsoneConnect With a Mentor Senior Oracle DBACommented:
LONG data types are actually no longer supported.  I believe that support for them was dropped in Oracle 9.

For character data (like HTML) use CLOB.
For binary data (like images) use BLOB.

LOB is just a general term for both of them.
0
 
Mark GeerlingsDatabase AdministratorCommented:
For bitmap image data, you have to use a: BLOB (short for Binary Large OBjects).  For html data, you can use a: CLOB (short for Character Large OBjects).  I think a LOB is just a newer replacement for LONG, but still ambiguous, since it can contain either binary or character data.
0
 
Russ SuterAuthor Commented:
That's basically what I thought. Is there any reason why I can't use a BLOB to store the HTML data also?
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
johnsoneSenior Oracle DBACommented:
There is no reason you cannot store HTML in a BLOB.  CLOB has more features (like you can do substrings and things like that).
0
 
Russ SuterAuthor Commented:
That's good to know. Obviously we're not using substrings and things like that with the LONG data type so it sounds like we won't be missing anything by just using BLOB.
0
 
johnsoneSenior Oracle DBACommented:
You probably wouldn't be missing anything, but it allows you do do more things without having to convert it later.
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.