Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers