cancel
Showing results for 
Search instead for 
Did you mean: 

Solution for "feature not supported: RETURN EXPRESSION"?

Former Member
0 Kudos

Hi,

Working on Hana Express edition with following details.

HDB version info:
  version:             2.00.000.00.1479874437
  branch:              fa/hana2sp00
  git hash:            2a3d5a559e1134fece774a8e60c6237ac1112d1f
  git merge time:      2016-11-23 05:13:57
  weekstone:           0000.00.0
  compile date:        2016-11-23 05:23:56
  compile host:        ld7272
  compile type:        rel

The code that I am trying to get to work is as follows. The error received on procedure execution is "feature not supported: RETURN EXPRESSION".

Actual requirement is to read a session context variable, which I got to work with a table function but that requires a SQL to be embedded in all places where the context variable is needed. I was trying to come up with a wrapper function around that other table function, so that the code still is maintainable.

What am I missing here?

DROP FUNCTION FTest;
CREATE FUNCTION FTest RETURNS sValue VARCHAR(1) 
language sqlscript 
reads sql data AS
begin
	RETURN 'Y';
END;


drop PROCEDURE ProTest ;
CREATE PROCEDURE ProTest 
AS
	sReceive VARCHAR(1);
BEGIN
	sReceive = FTest();
END;


CALL ProTest;


Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

You can delete the line with "RETURN sValue;" from your function. This is the statement which causes the error. It is enough just to set the "return parameter" sValue.

Answers (3)

Answers (3)

Former Member
0 Kudos

Tried this as following. Hope I understood what you meant.

I am running this via Eclipse and still get

Could not execute 'CALL ProTest'
SAP DBTech JDBC: [7]: feature not supported: RETURN EXPRESSION
DROP FUNCTION FTest;
CREATE FUNCTION FTest RETURNS sValue VARCHAR(1) 
language sqlscript 
reads sql data AS
	sValue VARCHAR(1);
begin
	sValue = 'Y';
	RETURN sValue;
END;

drop PROCEDURE ProTest ;
CREATE PROCEDURE ProTest 
AS
	sReceive VARCHAR(1);
BEGIN
	sReceive = FTest();
END;


CALL ProTest;

pfefferf
Active Contributor
0 Kudos

The error is in the function itself.

You are trying to return an expression value with

return 'Y';

But you have to assign your return value to the sValue variable defined as returning parameter:

sValue = 'Y';

Just replace your "return statement" by the sValue parameter assigned in the function and it will work.

Regards,
Florian

Former Member
0 Kudos

Any inputs please?