Subject Re: [firebird-support] How to get a "Substring" from a Memo Filed
Author Helen Borrie
At 12:22 PM 3/02/2004 +1100, you wrote:
>Hi Guys,
>
>I am trying to retrieve a Substring from a memo field in a Triger, and I
>am not very familiar with firebird.
>
>I just need to get everithing on the rigth of the last ";" or in other
>words copy to a new field everithing after the last ";" from a memo
>field. Can someone help me please with it?
>
>
>I would write it something like:
>
>Last_DotComma = 1
>Loop while Last_DotComma < Len(MEMO) or Last_DotComma = 0 or Len(MEMO) = 0
> Last_DotComma = INSTRING(';',MEMO,1) // ASSUMING the third param is
> "Starting from"
>end
>
>if Last_DotComma > 0 then new_string = SUB(MEMO,Last_DotComma + 1,Len(MEMO))
>END

You can store a string in a blob, but a blob isn't a string.

Firebird has no internal functions to operate on blobs.

Look at the external function F_BlobLeft in the FreeUDFLib. If your server
isn't on Windows, find a UDF to convert your blob to a string (if it is
32765 bytes or less) and operate on that string.


>Is there any "book" or PDF with all the valid Firebird SQL Functions??

The usual - LangRef.pdf,
(http://www.ibphoenix.com/downloads/60LangRef.zip), Firebird release notes
1.0 and 1.5.

The bulk of "Firebird SQL functions" are in external function
libraries. ibudf and fbudf are in your /UDF directory, along with scripts
for declaring them and a small amount of documentation in commented text.

You can pick up the Pascal or C sources for FreeUDFLib from the "UDF"
section of the Contributed Downloads pages at www.ibphoenix.com. There is
quite a lot of documentation with FreeUDFLib.

/hb