Subject Re: An alternative for ASCII_CHAR() ?
Author



---In firebird-support@yahoogroups.com, <helebor@...> wrote :

At 07:10 p.m. 4/06/2015, brucedickinson@... [firebird-support] wrote:


>Hello,
>
>I need to produce delimited text output from my stored procedure, for example:
>
>23;65;some text;
>
>The thing is that semicolon ";" might appear in one of the delimited fields and this will cause some bugs on the client side. So I want to change this character to a less common one. I've decided to use ASCII 7 - a "Bell" character.
>
>I am afraid that usage like this:
>
>DECLARE V_OUTPUT VARCHAR(1024);
>DECLARE V_PARAM VARCHAR(32);
>...
>
>V_OUTPUT = V_OUTPUT || ASCII_CHAR(7) || V_PARAM;
>
>will slow down my query because I will be doing a lot of concatenations. Correct me if I am wrong but I think that even if I put this code into stored procedure, ASCII_CHAR(7) will not be resolved at compile time and will be called over and over again?
>
>Is there other way to put my character directly into the query? For semicolon that was easy:
>
>V_OUTPUT = V_OUTPUT || ';' || V_PARAM;
>
>but how to do this with a Bell character?

>Just call the function once, in the declarations.

>Helen

Unfortunately, this won't help me that much because I need to call this block of code for each row and I have a lot of rows.

Regards.