LONG to CLOB within a trigger - alternative to synching data values?

From: Jeremy <jeremy0505_at_gmail.com>
Date: Thu, 7 Jan 2010 15:10:04 -0000
Message-ID: <MPG.25b009a593dc7c5f9897bb_at_News.Individual.NET>


Oracle 10g R2
Windows Server 2003

I realise it is not possible to reference the :new.longcolumn when the longcolumn is of datatype LONG.

We have a legacy table with a LONG column. We wanted to transition this to a CLOB but actually modify the application code over time (there are many potential dependencies on this column (and by the way the app was originally designed before CLOB was a supported datatype!).

We had thought we could simply:

alter table mytab
(clob_col clob);

and then in a trigger put e.g.

if inserting or updating then
  :new.clob_col := :new.oldlongcolumn;
end if;

Now, we cannot do this owing the lack of support fro this in Oracle.

Is there an alternative cunning method by which we could easily synchronise the new CLOB column with the LONG column's data content?

Received on Thu Jan 07 2010 - 09:10:04 CST

Original text of this message