on 07-01-2016 5:54 AM
Hi,
could anybody please let me know what is the issue with this procedure. Its giving me error at line 4 as it is not recognizing VAR1 input parameter.
CREATE PROCEDURE MULTI1 (IN VAR1 INTEGER, IN VAR2 INTEGER, OUT VAR3 INTEGER)
LANGUAGE SQLSCRIPT SQL SECURITY INVOKER AS
BEGIN
B = :VAR1 * :VAR2;
END;
Rgds
Hi,
Small Mistake in the code.
You have defined VAR3 as Output
But In formula, you mentioned that (B = :VAR1 * :VAR2)
So you are getting error that
SAP DBTech JDBC: [1287]: identifier must be declared: B: line 4 col 1 (at pos 129)
I changed the formula to VAR3 = :VAR1 * :VAR2.
It is working fine.
CREATE PROCEDURE MULTI1 (IN VAR1 INTEGER, IN VAR2 INTEGER, OUT VAR3 INTEGER)
LANGUAGE SQLSCRIPT SQL SECURITY INVOKER AS
BEGIN
VAR3 = :VAR1 * :VAR2;
END;
---------------------------------------------------------------------------
Call "INF713775"."MULTI1" (3, 2, ?)
Returns Output as 6.
Regards,
Muthuram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Muthuram,
Initially i kept it like that only but got that error. its still giving me error even though im putting it as:
CREATE PROCEDURE MULTI1 (IN VAR1 INTEGER, IN VAR2 INTEGER, OUT VAR3 INTEGER)
LANGUAGE SQLSCRIPT SQL SECURITY INVOKER AS
BEGIN
DECLARE B INT;
VAR3 = :VAR1 * :VAR2.
END;
Error is:
SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near ":VAR1": line 5 col 8 (at pos 153)
rgds
Again Minor mistakes.
1. Remove Declare B INT Line as you have not used anywhere.
2. In VAR3 Formula, At the End of line you have to use semicolon but you used fullstop .
Use the procedure I have given in previous reply, It should work.
Please go through this link for procedure syntax.
CREATE PROCEDURE - SAP HANA SQL and System Views Reference - SAP Library
Regards,
Muthuram
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.