Subject Re: [ib-support] Restoring Problem
Author Helen Borrie
At 02:24 PM 12-11-02 +1300, you wrote:

>if I have a following in stor proc
>
>declare variable s1 varchar (32000);
>declare variable s2 varchar (32000);
>declare variable s3 varchar (32000);
>.
>.
>.
>and if I want to do the following
>
>s1 = s2 || s3;
>I get the same exception. I need to do the above operation how do I get
>around it?

Try setting up s2 and s3 as varchar(16000) and then using CAST to limit the
size of the strings you pick up from the database. It's not a perfect
solution though, because it doesn't avoid the situation where you get an
overflow from one or both of the actual values having a length longer than
16 Kb.

Do you understand why the change was necessary? Previously, your code
module would compile successfully even if it had a statement like yours,
which would potentially cause an overflow exception at run-time if the
concatenation caused a product that exceeded the 32Kb limit...

As well (even without the compiler bug fix) your variables "don't
compute". You can't add 32 to 32 and produce a result of 32...it's not
sensible to define fields in your database that are not capable of
participating in the calculations you require for them.

heLen