Re: LONG vs. Multiple VARCHAR2

From: Richard Scholz <richard_at_subito.de>
Date: 1995/08/07
Message-ID: <richard.807790349_at_moon>#1/1


contillo_at_kaiwan.com (Michael Contillo) writes:

>My question is: Given the situation, what are the advantages and
>disadvantages of using a LONG datatype to store freeform text?

There are a lot of restrictions on LONG columns in Oracle. Most SQL Functions can't be used on these.

The biggest drawback, IMHO, is when you try to update a database to a newer version of your database structure. You'll get problems, if you try to drop colums from a table, which contains LONGs. Oracle can't drop columns directly, so you have to do some tricks. Like, creating the table under a different name withthe new structure you want (omitting the to be dropped column), then filling it with a INSERT INTO .. SELECT .. and then dropping the old one, and renaming the original one. But INSERT INTO .. SELECT .. doesn't work, when your table contains LONGs. also UPDATE .. SET (x,y,z)=(SELECT ..) doesnt work, when a LONG column is referenced.

Next drawback: only one LONG per table. So if you need more than one Freeform Text field in one table, you'll have to do the chunks anyway.

In short, if you don't want your database administrator to get grey hair, then keep him out of the hassle and don't use LONGs. It makes life easier.

Greetings, Richard (with no grey hair yet :-)



Richard Scholz, Subito Software GmbH, Frankfurt, Germany richard_at_subito.de Received on Mon Aug 07 1995 - 00:00:00 CEST

Original text of this message