Re: Convert Long to Long RAW in 10gR2

  • From: Phil Singer <psinger1@xxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 15 Jan 2007 12:28:51 -0500

VIVEK_SHARMA wrote:
Folks




Of a 10gR2 Database, in a 700 GB Table the LONG Field contains standard
JPEG Image with JFIF Compression.




Oracle Corp's reply "If you wan to store JPEG's in a Table then you need
to use LONG RAW instead of LONG or better BLOB & you need to change this
*before* going to UTF8."


Been stuck with a 9i database with a legacy LONG RAW column in a 60G table. Nothing but trouble. Loved to tell my boss "see, you should have let me convert it to BLOB back when we could".



NOTE - A Pro*C Application accesses the respective LONG field to display
the Respective JPEG Image.


Ours was VB, but the problem is the same. Can't touch the data through the database; must use a 3GL tool instead.


Qs. What are easier ways to convert the LONG field to a LONG RAW field?
Will conversion need an additional 700 GB Space?

Only way I know:

0) Back up the tablespace containing this table (I hope it is the only table in the tablespace).

1)  Use your 3GL tool to dump each datum to a flat file.

2)  Create a new table, just like the old, but without the column.

3)  Copy all data but that column to the new table.

4)  Use your 3GL tool to update each row with it's JPEG.

If you just drop the column, and then add the new one, you won't need any more space. Just don't let anything go wrong (practice this first on a disposable table).



Qs Will conversion to LONG RAW field impact the Image access Functions,
respective Pro*C Code & thus need a  corresponding Change? (Conversion
to BLOB will certainly necessitate a Change in the manner of access i.e.
respective Functions & Pro*C Code, to my understanding)


My guess is your Pro*C will need very minor tweaks.

I also think that you will be _much_ happier if you find a way to convert to BLOB, painful as the process will be.




--
Phil Singer                         |   psinger1 at chartermi dot net
PhD, OCP, and All Around Good Guy   |   Do the Obvious to Reply
--
//www.freelists.org/webpage/oracle-l


Other related posts: