Subject Re: [firebird-support] Re: CAST() string as BLOB for use as a memo field in VFP
Author Helen Borrie
At 09:30 PM 19/11/2007, you wrote:
>Hi Helen
>
>--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>> I can't tell in which direction you want to do the conversion...are
>you storing a Firebird varchar in a VFP Memo, or is it that you want
>to store a long string from VFP into a TEXT blob?
>
>I want to create the string in FireBird backend, using a template
>stored in another FireBird table (but I am still lost in this matter).

Alright. As you are handling strings, your main limitation is that a varchar must not exceed 32,765 *bytes* in length. If you are using MBCS, the limit would be proportionately shorter in *characters*.

I don't know what sort of "template" you had in mind. You can't format strings, other than to include tab and CRLF characters. But it would be feasible to construct the string by concatenating varchars in a stored procedure and return it directly to the caller, without need to store a blob.

However, you can pass a string literal to a text blob, nothing that blobs are never "updated". Updating a blob means replacing the old blob with a new one. The engine makes this transition for you.


>If not I just want a basically populated BLOB field from FireBird and
>I can append the string (with more SQL Pass Thrus) in VFP.

You can't append anything to a blob. You would need to suck out a suitably sized substring from a text blob, and append to that *if* you can be certain of avoiding overflow.

>The reason for such a requirement is that I want to create a flat file
>for accounts ledger reporting purposes. The Narration for a given
>entry in one of the FireBird tables is to be generated on the fly for
>this flat file. The biggest problem is that the narration
>(essentially textmerge) is user defined and changeable.

Well, the whole design algorithm will be driven by the size limits on strings.

./heLen