Subject | Re: URGENT - CONCATENATION ERROR - BUG |
---|---|
Author | crizoo4712 |
Post date | 2008-01-27T21:54:56Z |
Hi Svein,
as I wrote to Martijn, strlen isn't the problem.
I removed it meanwhile.
The error still occurs by concatenating something to TXT, which
causes TXT to be longer than 255 characters.
regards, Christoph
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
as I wrote to Martijn, strlen isn't the problem.
I removed it meanwhile.
The error still occurs by concatenating something to TXT, which
causes TXT to be longer than 255 characters.
regards, Christoph
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>haven't
> Modifying your function a little bit (mainly to fit my system, I
> got any UDFs installed on this PC):(12345678)
>
> CREATE PROCEDURE P_TESTCONCAT (
> NUM Integer)
> returns (
> TXT VarChar(2000))
> AS
> DECLARE VARIABLE CTX VARCHAR(13) DEFAULT ' BEZEICHNER: ';
> BEGIN
> TXT = '';
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> /* THE NEXT COMMAND CAUSES THE ERROR, THE LENGTH OF THE RESULT
> EXCEEDS 255 CHARACTERS */
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> TXT = TXT || CTX || CAST(NUM AS VARCHAR(8));
> SUSPEND;
> END
>
> everything works OK when I issue SELECT TXT FROM P_TESTCONCAT
> (using Fb 1.5.4 SS). Hence, my guess is that your problem isrelated to
> the UDF STRLEN (which, strictly speaking, isn't a Firebirdproblem). I
> practically never use UDFs myself, but guess it has something to dowith
> how you defined the udf - at least that seems like the cause in adosen-t-work-properly-141568.html
> similar problem here:
>
> http://forums.devshed.com/firebird-sql-development-61/udf-substr-
>
> HTH,
> Set
>
> crizoo4712 wrote:
> > the following sp causes the same error.
> > "..is not a valid floating point value" in debug mode.
> >
> > CREATE PROCEDURE P_TESTCONCAT
> > AS
> > DECLARE VARIABLE TXT VARCHAR(2000) DEFAULT '';
> > DECLARE VARIABLE CTX VARCHAR(13) DEFAULT ' BEZEICHNER: ';
> > DECLARE VARIABLE NUM INTEGER DEFAULT 12345678; /* THIS IS A VALID
> > NUMBER, INTEGERS CAN STORE UP TO 2,147,483,647 */
> > DECLARE VARIABLE LEN INTEGER;
> >
> > BEGIN
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > /* THE NEXT COMMAND CAUSES THE ERROR, THE LENGTH OF THE RESULT
> > EXCEEDS 255 CHARACTERS */
> > TXT = TXT || CTX || CAST(NUM AS VARCHAR(8)); LEN = STRLEN(TXT);
> > END
> >
> > regards, christoph
>