Subject Re: [firebird-support] CAST() string as BLOB for use as a memo field in VFP
Author Helen Borrie
At 05:40 PM 19/11/2007, you wrote:
>Hi all
>
>I would like to do the following from VFP as an SQL Pass Through
>
>SELECT CAST('Opening Balance' AS BLOB SUB_TYPE 0) AS mNarration from
>MACCOUNTS
>
>I cannot do so even in FlameRobin. Please advise what I am doing wrong.

You can't cast anything as a BLOB. The data type of the enclosed data is "unknown" to the engine. Even a Text blob (sub_type 1, not 0) is not a string; although you can extract a string from a Text blob using SUBSTRING().


>The reason for this is that I have unknown lengths of string for this
>field and would like to bring it in as Memo field in VFP.

A "memo" field is blob sub_type 1, a.k.a. blob sub_type TEXT. To convert a long string to a text blob you will need the mediation of some client code.

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?

./heLen