views:

101

answers:

2

Why is long an issue with Oracle?

It will be better if some one can tell me what are the issues with using the long data type in oracle? something related to storage?

I was asked this in an interview.

+1  A: 

LONG is archaic and deprecated, and has been superseded by CLOB. There are lots of restrictions with LONGs and they are difficult to manipulate in SQL. So while you may have to deal with them in old databases, you would be unwise to ever use a LONG column in a new table.

Tony Andrews
So should i alter my table if i am using long ???? since it ll be phased out finally
Egalitarian
It will probably never disappear completely as too many old databases would break. If the table has been in use for a long time and there is code written to cope with a LONG column then probably best to leave it alone.
Tony Andrews
So how to deal with long in databases in which i can not change the attribute type to CLOB. some one suggested that write chunks of data but how to do that?? any idea .. or can u provide me a link?? which gives me the code as well
Egalitarian
A: 

Unfortunately, LONGs are still sometimes necessary. For example, you can read a LONG from a remote database, but you can't read a CLOB. (Although you can write a CLOB to a remote database.) I'm guessing this is why they are still used everywhere in the data dictionary.

Other than that issue, you should probably always use CLOBs.

jonearles
So how to deal with long in databases in which i can not change the attribute type to CLOB. some one suggested that write chunks of data but how to do that?? any idea .. or can u provide me a link?? which gives me the code as well
Egalitarian