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: long fields update

Re: long fields update

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Mon, 06 Sep 1999 19:20:50 +0800
Message-ID: <37D3A392.573F@yahoo.com>


Silvia Mazza wrote:
>
> Hi all,
>
> we have to update a long field.
> We cannot do this from sqlplus (too long input string).
> We tried to separate the value of the field in different pieces and to
> concatenate them by executing different updates, but it is not possible
> to concatenate the value of a long field.
> Is there somebody who has a piece of code (pl/sql or C) doing this? We
> are in a hurry for only 5 records!
> Our Oracle installation is version 7.3.4 on Nt.
> Thanks eveybody!
> Ciao Silvia
>
> --
> --------------------------------------------
> Quinary SpA, via Fara 35, 20124 Milan, Italy
> http://www.quinary.it
> mailto:S.Mazza_at_quinary.it
> tel +39-02-6774111 fax +39-02-67741156
> --------------------------------------------

If the long column is less than 32767 bytes, then you can use pl/sql to do it..otherwise its more complicated (ie C time)

In PL/SQL

declare
  x varchar2(32767);
begin
  select long_col
  into x
  from my_table
  where col1 = ...

  x := .... (new data etc etc)

  update my_table
  set long_col = x
  where col1 = ...
end;

Have fun
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Mon Sep 06 1999 - 06:20:50 CDT

Original text of this message

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