Subject Re: [firebird-support] FireBird 2.5 Varchar problem
Author Hans
But this works for me, puzzled :)

CREATE PROCEDURE varchar_test //( )
RETURNS (TEXT VARCHAR(80) )
AS
DECLARE VARIABLE REPORT VARCHAR (32000);
DECLARE VARIABLE M INTEGER;
DECLARE VARIABLE N INTEGER;
BEGIN

M = 0;
N = 0;
REPORT = '';

WHILE (0 = 0) DO
BEGIN
REPORT = REPORT || 'My test' || ascii_char(10);

N = CHAR_LENGTH(REPORT);

IF (N > 31000 OR N <= M) THEN
BEGIN
TEXT = 'QUIT ON CHAR_LENGTH = ' || N;
SUSPEND;
EXIT;
END
ELSE
M = N;

END

END

----- Original Message -----
From: "Hans" <hhoogstraat@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, October 29, 2010 5:24 PM
Subject: [firebird-support] FireBird 2.5 Varchar problem


> Hi Folks,
>
> In a procedure I'm trying to put some kind of report together using
>
> Declare Variable Report Varchar(31000)
>
> starting out with Report = ''; and appending pieces of information
> to the variable Report using either
>
> Report = Report || 'Some Text';
>
> or
>
> Report = Report || Some.Variable
>
> It keeps on failing when the Char_Length(Report) exceeds
> around 1072 to 1100 characters.
>
> Any idea what the reason could be, I thought I should be
> able to continue till at least a maximum char_length of about (31000 div
> 4)
> under FB2.5
>
> Best Regards
> Hans
>
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>