Subject Re: [ib-support] Appending a CR/LF to a string
Author Helen Borrie
At 02:21 PM 19-04-02 -0700, you wrote:
>Good Morning!
>
> I am trying to build a list of open sales orders
>like this:
>
> OpenSalesorders = OpenSalesorders ||
>Cast(:SalesOrderId as VarChar(7)) || #13#10;
>
> I would LIKE it to have a CR/LF after each order
>id. The line above does not work (compiler chokes on
>the #).

Yup - those are Delphi constants. :-))


> The desierd result is something like this:
> 51239
> 51347
> 43945
>
> Can anyone tell me how to do this?

Use the UDF from the FreeUDFLib, a fixed version of which you can get from
www.cvalde.com. The func you want is Character(), which takes an ascii
code as input and returns the actual character. Apart from storing the
actual characters as columns in a table (copy-pasted from a textfile) I
don't know of any other way you can get "untypable" characters into an
input clause.

Once you have the lib installed and the func declared to your db, you will
be able to store the linebreaks this way:

OpenSalesorders = OpenSalesorders ||
Cast(:SalesOrderId as VarChar(7)) || Character(13)||Character(10);

--- H

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________