Adding UDF_ReplaceStr to more than 4 columns of an existing query throws error SELECT Failed. 3577:

Extensibility

Adding UDF_ReplaceStr to more than 4 columns of an existing query throws error SELECT Failed. 3577:

I am trying to add a UDF (UDF_ReplaceStr) existing query that has been working for some time. As long as I am adding it to four or less of the columns it is OK but it throws the error "SELECT Failed. 3577: Row size or Sort Key size overflow." when adding it to the fifth.

Can anyone shed light on why?
2 REPLIES

Re: Adding UDF_ReplaceStr to more than 4 columns of an existing query throws error SELECT Failed. 3577:

Just a guess: The answer may have something to do with the result type of your UDF.

The parser calculates the result row size using the maximum size of the result column values. Suppose the declared result type of your UDF is something like VARCHAR(15000), then 4 columns of that type are assumed to use a total of 60000 bytes in the worse case. If you try to add a 5th value of the same type, it will exceed the maximum row size.

Re: Adding UDF_ReplaceStr to more than 4 columns of an existing query throws error SELECT Failed. 3577:

Jim,

Thanks for the idea. I added a substr() around teh other function to set the length for each column and that resolved the issue. I was able to get all 10 columns working