Subject Re: [firebird-support] Error copying text from BLOB to varchar
Author Waldo G. Wernli
A solution for that conversion is to use an udf library
For example: FreeUdfLib, available freely at www.ibphoenix.com

Copy the library FreeUdfLib.dll on folder /Udf in your Firebird installation
In a script window execute the following (register the function):

declare external function f_BlobAsPChar
blob
returns cstring(1024) /* free_it */ /* or 32000 or whatever... */
entry_point 'BlobAsPChar' module_name 'FreeUDFLib.dll';

And then

update MYTABLE set VARCHARFIELD = f_BlobAsPChar(BLOBFIELD)

Waldo.-
----- Original Message -----
From: robert_hollay
To: firebird-support@yahoogroups.com
Sent: Tuesday, January 04, 2005 5:21 AM
Subject: [firebird-support] Error copying text from BLOB to varchar



Hi all,

There is a textual BLOB field in a table, where the customer stores
some text (not too long, a few lines of names, addresses, etc...).
Last week the customer came forward with the idea that it would be
very nice if he could make a search on this field. No problem, I said,
I would change the BLOB field into varchar(300) and that's all.
I made a new field in the table, and tried to copy the old data:

update MYTABLE set VARCHARFIELD = BLOBFIELD

but got an error message: 'Overflow occured during data type
conversion. conversion error from string "BLOB" '.

The BLOB and VARCHAR fields have identical character sets.
How can I make this conversion?


[Non-text portions of this message have been removed]