Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Insert LONG type to another table by trigger: Internal error

Re: Insert LONG type to another table by trigger: Internal error

From: Edzard <edzard_at_volcanomail.com>
Date: 14 Mar 2002 09:12:43 -0800
Message-ID: <5d75e934.0203140912.777397a3@posting.google.com>


Hello,

It is indeed no practical to process LONG fields in triggers. But I think it can be done at the price of much extra complexity. As you are not allowed to use the :new value, the idea is just to select it from the table. So you add a query on the table itself: SELECT longfield INTO ctmp FROM table WHERE pkfield = :new.pkfield Then you can do the processing with the ctmp, which is of a VRACHAR2 of maximum size

Of course you will hit the mutating table error when you try to select from the table itself from within a row-level trigger. But there are thousands of work-arounds for that.

And, eh, hmm, somehow it does not always process the full LONG field even if temporary variable is large enough. Not sure if this is an error in my code but if you have large documents, there is problems to be expected.

Bye,
Edzard Received on Thu Mar 14 2002 - 11:12:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US