Subject | Re: [ib-support] Combining blob and varchar field value into |
---|---|
Author | Claudio Valderrama C. |
Post date | 2002-03-07T07:07:52Z |
""Ann W. Harrison"" <aharrison@...> wrote in message
news:5.1.0.14.2.20020306103318.02053550@......
H:\ibdev\fbbuild\interbase\ib_debug\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'b';
SQL> create table b(b blob sub_type text);
SQL> insert into b(b) values ('z');
SQL> create table dest(d blob sub_type text);
SQL> insert into dest(d) select 'z'||b from b;
Statement failed, SQLCODE = -413
conversion error from string "BLOB"
=> of course I can't, I'm mixing a string and a blob
SQL> insert into dest(d) select 'z'||substring(b from 1 for 30000) from b;
SQL> select d from dest;
D
=================
81:0
=================
D:
zz <=== here's the concatenated value
=================
I concatenated a string with a blob in one table to insert it into the blob
field in another table.
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing
news:5.1.0.14.2.20020306103318.02053550@......
> At 04:07 PM 3/6/2002 +0800, Junior Ang wrote:handles.
>
> >I am trying to insert into a blob fied a combined data from a varchar(50)
> >field and memo (blob field with text subtype), but I got the blob
> >conversion error, is there a workaround for this? I tried FreeUDFLib's
> >f_BlobAsPChar, but my memo contains more bytes that it could safely
>Something like this?
> What version of Firebird (or InterBase) are you using?
H:\ibdev\fbbuild\interbase\ib_debug\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'b';
SQL> create table b(b blob sub_type text);
SQL> insert into b(b) values ('z');
SQL> create table dest(d blob sub_type text);
SQL> insert into dest(d) select 'z'||b from b;
Statement failed, SQLCODE = -413
conversion error from string "BLOB"
=> of course I can't, I'm mixing a string and a blob
SQL> insert into dest(d) select 'z'||substring(b from 1 for 30000) from b;
SQL> select d from dest;
D
=================
81:0
=================
D:
zz <=== here's the concatenated value
=================
I concatenated a string with a blob in one table to insert it into the blob
field in another table.
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing