cancel
Showing results for 
Search instead for 
Did you mean: 

User defined function does not work in SELECT statement with "column table"

Former Member
0 Kudos

Hello,

On HANA SPS09 the user defined function (UDF) with NVARCHAR input parameter works in SELECT statement with "ROW TABLE". But it does not work in SELETE with "COLUMN TABLE". Is this a bug?

With best regards,

Y.Hu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yujun,

I guess this thread is related with . I just tested a simple column table based on your UDF and it worked on Rev. 91.


create column table test (name nvarchar(100));

insert into test values ('a');

drop function FN_TEST2;

create function FN_TEST2

(vInput nvarchar(100))

returns vReturn nvarchar(100)

LANGUAGE SQLSCRIPT

as

begin

    vReturn := 'Hello_' || vInput;

end;

--------------------

select FN_TEST2('abc123') from dummy;

----> It works. Output: Hello_abc123

--------------------

select FN_TEST2(name) from test;

----> It works. Output: Hello_a

Best regards,

Wenjun

Former Member
0 Kudos

Hi Wenjun,

Thank you for your test. This is a good news.  I have still the version 1.00.85.00.397590. I have to wait for Rev. 91 or higher.

Best regards,

Y.Hu

Former Member
0 Kudos

I've had similar problems with UDF.

When they have "constant" input parameters there's no problem, but when they work on an entire column you can find that error.

We also found that the UDF works with "few" rows, a SELECT TOP 1000 for example, but working with the entire table you have the error again.

We have SAP HANA rev is 85, and maybe this is a bug that is not present in rev 91.

Do you have any SAP Note about this error? I haven't could find any.

Answers (0)