cancel
Showing results for 
Search instead for 
Did you mean: 

Scalar UDF accessing HANA DB

Former Member
0 Kudos

Hi,

I'm trying to create a simple scalar UDF that provides an aggregated value from a table, given an input. When I do so, I get the following error, which implies it's not possible:

SAP DBTech JDBC: [7] (at 194): feature not supported: Scalar UDF does not support TABLE operations: line 5 col 1 (at pos 194)

Is it not possible to call SQL from a UDF in SP06?

John

DROP FUNCTION test_udf;

CREATE FUNCTION test_udf (customer CHAR(16))

RETURNS quantity INT

LANGUAGE SQLSCRIPT SQL SECURITY INVOKER READS SQL DATA AS

BEGIN

quantity = select SUM(quantity) AS QTY from SALES WHERE customer = :customer;

END;

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've been playing with this and it looks like the Scalar UDF in SP06 is very limited. It doesn't support the CHAR data type, and doesn't support any SQL functions.

I thought I could get around my problem by pushing the SQL out into a Scalar Procedure but I can't even do CALL() within the UDF.

Looks like I need to find a different way to solve my problem.

John

rama_shankar3
Active Contributor
0 Kudos

Thanks John for sharing this issue!

Former Member
0 Kudos

Hi John,

Have you got any alternative approach to solve this problem ? We are also stuck at the same point.

Please share the soln.

Cheers,

Papil

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi John,

I have the same problem. Please share your solution to this issue if you found it.

Joanna

lucas_oliveira
Advisor
Advisor
0 Kudos

Hello,

Please don't revive dead-old-and-answered threads. Create new ones and refer to this one if necessary. Attention to .

Thanks,

Lucas de Oliveira (moderator)