Hi friends,
In this post i'm going explain the use with result view use in SAP HANA Procedure.
WITH RESULT VIEW <view_name>
<view_name> ::= <identifier>
Specifies the result view to be used as the output of a read-only procedure.
Example - Creating an SQL Procedure with Result View:
create procedure "KABIL_PRACTICE"."ARRAY_UNNEST_SIMPLE_With_Result_View"(OUT result "KABIL_PRACTICE"."TTYPE")
LANGUAGE SQLSCRIPT
READS SQL DATA with result view "KABIL_PRACTICE"."ARRAY_UNNEST_RES"
as
begin
declare ID integer array := array(1,2);
declare NAME nvarchar(65) array := Array ('name1','name2','name3');
result = UNNEST(:ID,:NAME);
end;
To Call a Procedure:
call "KABIL_PRACTICE"."ARRAY_UNNEST_SIMPLE_With_Result_View"(?);
RESULT:
we can also see the same result by using the select statement with the view name which is we created in a procedure.
select * from "KABIL_PRACTICE"."ARRAY_UNNEST_RES";
No comments:
Post a Comment