cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Datasphere: Table Function - Union with Tuple instead of a Table

mitko1994
Participant
0 Kudos
647

Hello, 

I'm creating a SQL-based View in Datasphere. I have a requirement to create multiple versions from the same record I'm looping over. I have inititalized a table variable to hold my result and have created a cursor over my source table. Based on each iteration, I manually create the tuple that I would like to insert as my new record. The issue that I'm facing is appending to my result table. I want to overwrite my result table as the union of itself with the new record, but the syntax check fails as a "from" clause is expected implying that I have to use a table. I know that what I'm trying to achieve is possible on other DBs and SQL flavors but cannot seem to find the equivalent on HANA. Any ideas? I have attached a screenshot of the code snippet.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

UlrichM
Discoverer
0 Kudos

Hello,

I have not tested this logic in Datasphere, but in other systems (e.g. BW/4) you select from dummy table. See example in the following blog:
https://community.sap.com/t5/technology-blogs-by-sap/use-of-dummy-table-for-mocking-and-testing-logi...
Hope this helps.

mitko1994
Participant
0 Kudos
Thanks. I tried that already, but the system didn't know about the table.