Skip to Content

Unexpected Error Code 339

Oct 28, 2016 at 06:11 AM


avatar image


I have a table variable in my HANA procedure that contains name-value pairs. I have chosen NVARCHAR(200) as the data type for the "value" column. The values that I am putting into this variable are of different types, some CHAR and some others (like DATE etc.) but I am taking care of type-casting all the non-CHAR values.

The issue I am facing is that when I use (for e.g in a JOIN) the table variable in the procedure, I get SQL error 339 (invalid number). I am unable to figure out where exactly the error is coming from. When I don't use the table variable anywhere but just let the code for populating the variable execute, I don't get the error!

I am using the table variable in two ways:

  1. In an OUTER JOIN
  2. In a REPLACE statement where I am substituting the "value" from the table variable into a line of text.

In both the above usages, I don't see any reason for any kind of type conversion to a number, or for having anything to do with numbers at all.

Would you have any inputs that could help resolve the issue?


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Kumar Akshat
Oct 28, 2016 at 10:16 AM

Problem solved. The error message was kind of misleading as the real problem was with one of the integer fields that needed a special TO_NVARCHAR typecasting.

10 |10000 characters needed characters left characters exceeded