Subject | Re: [firebird-support] EOL Literals in SQL |
---|---|
Author | Helen Borrie |
Post date | 2005-03-04T06:40:15Z |
At 09:15 AM 4/03/2005 +0400, Dimitry Sibiryakov wrote:
What you say is quite true. :-) However, as I interpreted the original
message, the task to do is a one-off operation to create the text string
from existing varchar data and plug it into the blob field.
This, for example, works fine:
create table text2blob (
id integer,
name1 varchar(40),
name2 varchar(50),
memo blob sub_type 1);
commit;
insert into text2blob
values (1, 'George Dubbya Bush', ' will not be remembered as a statesman',
'Some old string' || '
'|| 'Some other old string';
commit;
update text2blob
set memo = name1 || '
'|| name2;
commit;
./heLen
>On 3 Mar 2005 at 17:51, Chad Z. Hower aka Kudzu wrote:Dmitry,
>
> >I have a blob (text) that I need to update with some data from some
> >other fields. This is a new field in the table, and for historical
> >purposes I need ot just fill in the data for existing rows. The system
> >will populate new rows.
> >
> >I need to embed some EOLs though. So something like
>
> Helen's suggestions won't help you because BLOB can't be updated
>this way.
> BLOB is a big bunch of bytes. It is stored and retrieved as a
>whole. There is only one way to add something to BLOB: get it's whole
>content to client application, modify and put back.
What you say is quite true. :-) However, as I interpreted the original
message, the task to do is a one-off operation to create the text string
from existing varchar data and plug it into the blob field.
This, for example, works fine:
create table text2blob (
id integer,
name1 varchar(40),
name2 varchar(50),
memo blob sub_type 1);
commit;
insert into text2blob
values (1, 'George Dubbya Bush', ' will not be remembered as a statesman',
'Some old string' || '
'|| 'Some other old string';
commit;
update text2blob
set memo = name1 || '
'|| name2;
commit;
./heLen