Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Appending data to a LONG field
In article <330E333B.1CC8_at_ehv.sc.philips.com>, Shaun Mallory
<S.mallory_at_ehv.sc.philips.com> writes
>I have a table that has a LONG field that is used to store long bits of
>text. I am wanting to append a bit of text onto the front of the text
>that already exists in the field. I tried:
>
> UPDATE Table
> SET Text_Field = 'My New String ' + Text_Field
> WHERE etc....
>
>and I got the error ORA - 00932 Inconsistent Datatypes
>
>Then I tried and got the same result:
>
> UPDATE ....
> SET Text_Field = ' My new String' + TO_CHAR(Text_Field)
> WHERE ...
>
>I'm sure I can come up with a way to extract the data from the field
>into a variable, add my new string and update the field with the new
>complete string. This could become problematic if the LONG field gets
>very large. Is there a way to append new text onto the LONG field in an
>efficient manner.
>
>Please help me out
>
>Shaun
>smallory_at_ehv.sc.philips.com
What you need to do is use the cocatenation command. Your sql should look like this
UPDATE ...
SET Text_Field = ' My new String'||TO_CHAR(Text_Field)
WHERE...
-- KeithReceived on Sun Feb 23 1997 - 00:00:00 CST
![]() |
![]() |