Hi Guys
I want to call stored procedure from another stored procedure and insert the result into temp table like this
insert into #temptable | |
| select * from call spGetCustomers(currID.customerId); |
I have the stored procedure works on sql anywhere, but the same way not working on SAP Hana .
CREATE PROCEDURE spGetCutDetails (IN countryId VARCHAR(50),)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN
declare customerId INTEGER;
create local temporary table #temptable
(
customerId varchar(10) null,
countryId varchar(50) null,
firstName varchar(50) null,
LastName varchar(50) null
);
BEGIN
declare CURSOR IDs FOR
select ASA.customerId
from customers
FOR currID as IDs DO
insert into #temptable
select * from call spGetCustomers(currID.customerId);
END FOR;
select customerId,countryId,firstName,LastName from #temptable;
drop table tempTemprature;
end;
END;
Thank you
Bassam