on 02-28-2017 11:30 AM
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;
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any inputs please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.