Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
922 views
in Technique[技术] by (71.8m points)

database - Oracle: LONG or CLOB?

From these two threads,

LONG is archaic and deprecated. Oracle says,

Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.

Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.

But you cannot read a CLOB from a remote database without the workarounds mentioned here.

Which one should I prefer to store some text in my tables? Or is there a better solution than these two?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use CLOBs. One limitation of LONG is that LONGs can't be handled correctly from SQL - PL/SQL.

For a more detailed description of the differences, see http://www.comp.dit.ie/btierney/oracle11gdoc/appdev.111/b28393/adlob_tables.htm#insertedID2


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.6k users

...