Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want pass the array value to stored procedure , So I wrote array as the input parameter in stored procedure.
I am doing this one in sap hana, I have tried one query but it shows error .
Help me to overcome this problem.

What I have tried:

SQL
CREATE PROCEDURE Get_FG (IN DocEntNo INTEGER ARRAY[])
BEGIN
    DECLARE z,x integer;
    SET z=0;
    SET x=LENGTH(DocEntNo);
   -- set z= LENGTH(ARRAY);
   WHILE (z<x) do
     BEGIN
     SELECT  ' ' "Selection", "DocEntry", "U_ItemNo", "U_Description", "U_Quantity", "U_Date", "U_whse"
	 FROM "MELWIRE_TEST"."@APLANLINE" 
	 WHERE "@APLANLINE"."DocEntry" = :DocEntNo[z] AND  "@APLANLINE"."LogInst" IN 
	 (SELECT MAX("LogInst")FROM "MELWIRE_TEST"."@APLANLINE" WHERE "DocEntry"  = :DocEntNo[z] GROUP BY "U_ItemNo")
       SET z=z+1;
     END;
  END WHILE;
END;
Posted
Updated 30-Oct-17 20:38pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900