Skip to Content
0

SAP HANA - Is it Possible to Pass Variable to Stored Procedure?

Dec 21, 2016 at 02:12 AM

70

avatar image

Dear Experts,

I want to pass a variable value to a stored procedure, but it doesn't work fine...

What I am trying is as below....

1.Create a Stored Procedure

CREATE PROCEDURE SP_SAMPLE_IN_PARAMETER
(IN DocKey INT)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
READS SQL DATA
AS
BEGIN
SELECT DocKey AS "IN_PARAM" FROM DUMMY;
END;

2.Call the SP from query with an in-parameter

DECLARE DocKey INTEGER;
SELECT 111 INTO DocKey FROM DUMMY;
CALL SP_SAMPLE_IN_PARAMETER (DocKey);

As a result of the query, no data shows up.

Any helps would be appreciated.

Best regards,

K

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers