Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

call stored procedure from anothor stored procedure with select statment

$
0
0

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


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>