Subject Re: [IBO] Newbie - TIB_ColumnMemo, blobs and character sets
Author ericthorniley
--- In, Helen Borrie <helebor@t...> wrote:

> I'm not clear what you are talking about here. In the case of
> and BLOB SUB_TYPE 1 it is the programmer's responsibility to
ensure that
> the input text has the right character set. This involves
> a) defining the right charset in your DDL
> b) providing client support for that charset by connecting using
that charset
> and
> c) providing the means for the client enter only characters
recognised by
> that charset.

> What do you think you are looking for? The IB_Connection and its
> descendants have the Charset property...

Delphi works generally in the character set used by Windows -
WIN1252 for most of us. If you define a fully international
UNICODE_FSS VARCHAR column in the DDL and correctly tell the
IB_Connection that the client is using WIN1252, FB does a wonderful
job of converting all the text between the character sets so it
works just as if the column itself was WIN1252.

I wanted to get the same to happen with a BLOB column (because FB
creates excess network traffic if you use large VARCHARs that
normally contain small amounts of text). The automatic
transliteration between character sets does not happen with BLOB
SUB_TYPE 1 unless the low-level code (deep inside IBO or IBExpress)
specifically tells FB to use filters when accessing the data.

Of course if the column is the same as the client, no
transliteration is needed so, provided all clients are on the same
data set, you would never know there was a problem.

> A column that is defined in the database as BLOB SUB_TYPE 1 will
appear in
> your prepared dataset's Fields[] array as a TIB_ColumnMemo. There
> various methods that you can use to assign text objects to this
> type. I'm not clear what you mean by "required filter
operations". Are
> you talking about a custom blob filter that you have added to your

No custom blob filter - the filters are, I'm sure, already there.
However, to tell it to use them, you have to add parameters when
opening the blob with isc_open_blob2 or isc_create_blob2.

You should only add the parameters if the blob is SUB_TYPE 1.

You can find out that it is SUB_TYPE 1 after you have opened the
blob with isc_open_blob2 or isc_create_blob2 - and I guess that is
the point at which IBO decides that it should be a TIB_ColumnMemo
rather than TIB_ColumnBlob.

If I have guessed correctly then for IBO to request filters
automatically it would have to close and re-open the BLOB every time
it found it was SUB_TYPE 1. That would hardly improve the
perormance. So, to enable the filters (and hence the VARCHAR-style
transliteration), there would have to be some way for the user of
the IBO component to warn it that a particular column would, when
opened, be sub_type 1 and perhaps specifically request filters.

> >I think I may have been looking for the impossible. Can anyone
> >confirm that?
> No. You can do whatever you need to do. You could start by
> just what it is that you are trying to do...

Thanks for the response - I hope I've now explained it.

Of course it is not impossible to get it to work by writing code low-
level to access the API, but I fear it may not be possible to
configure IBO to do the work for me. Certainly IBExpress has a nil
blob parameter block in its calls to isc_open_blob2 and
isc_create_blob2 so I'm sure it can't do it. (I've only downloaded
the evaluation IBO so I can't look to see whether it is the same in