Skip to Content
-1

How to insert data into a table type in sap hana?

Apr 21, 2017 at 02:05 PM

396

avatar image
Former Member

Hi all,

Requesting your help to recreate a row type data entry and data retrivel kind of operations in sap hana.

I am unable to assign any data or variable information into sap hana table type variable.

I am to access the data only as a out parameter in a stored procedure for those which return a specified result set.

Kindly help me out to put data in table type and do manipulative operations above it.

Thanks in advance

With warm Regards

Aswin Sankar M

10 |10000 characters needed characters left characters exceeded

Please show your example and describe with that example what issues you have.

1
Former Member

Hi Florian,

i am developing the replica of a oracle procedure in sap hana.

Now i have code like below

create procedure proc1

( var0 in pls_integer

,var1 out table1%rowtype

)

as

var1 table1%rowtype

cursor c1 as

select * from table1

where c1 = var0;

begin

open c1

fetch c1 into

var1

close c1

end;

here as a substitute for row type i am utilizing the table type of SAP hana but as such it is not allowing me enter the data in the table type variable and only cache the data from some procedure.

Please help me in sorting this out thanks !

With warm Regards

Aswin Sankar M

0

Maybe you can describe your business case and why you wanna fetch data from a cursor and store it in a table variable instead of doing the select directly (with storing the data in a table variable).

1
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sergio Guerrero Apr 21, 2017 at 02:31 PM
-1

if on HANA 2.0 SPS1 - here is a blog from Rich

https://blogs.sap.com/2017/04/18/sap-hana-2.0-sps-01-new-developer-features-database-development/

for prior releases ...

you will need to select into the var... like

varA = select * from :varA inner join <other table> on condition .....

or

varA = select * from :varA union select * from :varB; /// make sure the columns are the same

hope this helps

Share
10 |10000 characters needed characters left characters exceeded