cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected Error Code 339

kakshat
Advisor
Advisor
0 Kudos

Hi,

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?

Thanks,
Akshat

Accepted Solutions (1)

Accepted Solutions (1)

kakshat
Advisor
Advisor

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.

Answers (0)