cancel
Showing results for 
Search instead for 
Did you mean: 

Nested table in hana by using Calc views

Former Member
0 Kudos

I have a requirement to get data in the below format from hana, I have written a Calc view..but I am not sure how get to store the looping data (Awards, Wall of fame) by using Nested table. So that I can get the data in the below format. I am using Java Spring Framework to call the calc view.

Main table have to contain Awards and Wall of fame has nested tables.

{

  "Name": "A",

  "No": 89700,

  "Awards": [

    {

      "Award_key": 1,

      "Award_name": "Best Performer1"

    },

    {

      "Award_key": 2,

      "Award_name": "Best Performer2"

    },

    {

      "Award_key": 3,

      "Award_name": "Best Performer3"

    }

  ],

  "Wall_fame": [

    {

      "WF_key": 1,

      "WF_name": "Best Performer1"

    },

    {

      "WF_key": 2,

      "WF_name": "Best Performer2"

    }

  ]

}

Need help.

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Just by using the calculation view, you will not get the required format. The calculation view just returns a flat/denormalized structure. To get that normalized structure you could use an XSJS service to prepare that JSON response. Another way would be to use an XSOData service with three entities (base entity, awards, wall frame) and the necessary dependency/navigation settings. Doing a GET request on the base entity with an expand on the two dependent entities would give you then the result in a similar form.

Former Member
0 Kudos

Thanks for the reply ..Florian.

I was expecting Hana would support Object and table types as Oracle render the same JSON structure with nested Object and table types.

Answers (0)