Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Meyer.

Asked: January 10, 2003 - 12:14 pm UTC

Last updated: September 15, 2007 - 7:28 pm UTC

Version: 8I and 9I

Viewed 1000+ times

You Asked

1)It is my understanding, at that at this point it is always better to use Blobs instead of Longs...is that correct or wrong (table defs and pl/sql)?

2)When (if ever) do you still use longs?

3)For asktom, is our posts stored as longs or blobs...and if you re-created it now...would it be the same?

4)Specifically going to create a web app that will store/display standard text that could probably fit in a varchar(4000), but want to be ready for longer entries (just in case)...They will be displayed/sorted based on other columns in the table. Lob or Long for the text?

Thanks,
Meyer



and Tom said...

1) in the database -- do not use long or long raw -- only use blobs and clobs

in plsql, long is really just varchar2(32765) and long raw is just raw(32765). If you need a big string, go ahead and use long -- it is just a subtype that is a varchar2 in disguise.

2) never

3) clobs -- all in clobs. Yes, it would be the same.

4) CLOBS are the only type you should even think about considering.

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks

Meyer, January 10, 2003 - 1:01 pm UTC

When I read my post,
Realized Ioften use the term Blob where I should use Lob or Clob.

Thank you for the concise and accurate answer.




More information about LONG's or LOB's

Murilo Ferrari, September 07, 2007 - 7:19 pm UTC

Tom,
Could be more especific about why I have to use LOB instead of LONG or LONG RAW?
Could you list here the best and the worst of them?

Thanks.
Tom Kyte
September 12, 2007 - 10:21 am UTC

because lobs are infinitely MORE FUNCTIONAL.

you can query them and use functions on them
you can insert as select them
you can do things with them over dblinks

and so on.

just don't use long and long raw, they are so hard to work with

LONG in oracle objects

Akki, September 12, 2007 - 11:26 am UTC

Do you see any possibility that all Oracle directory objects containing LONG columns get converted to CLOBS in future releases?
Tom Kyte
September 15, 2007 - 4:42 pm UTC

sure, maybe, some day

image store

venu babu, September 13, 2007 - 8:04 am UTC

i requested every one please give the syntax and one real time example, for the fourms. It is better way to understand the concept well.
Tom Kyte
September 15, 2007 - 7:28 pm UTC

I am famous for saying:

eh?
huh?

More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here