Question: hello everyone i have the following function:

```
function Entfernung(v_stadt  Rheinlandstädte%rowtype) 
Return Abstandstabelle is

tabelle ABSTANDSTABELLE;

cursor c_städte IS
Select *
 From Rheinlandstädte
 ;
v_andereStadt  Rheinlandstädte%rowtype;
v_entfernung float;

begin

Open c_städte;

  LOOP

  fetch c_städte into v_andereStadt;
  v_entfernung := Abstand(v_stadt, v_andereStadt);
  tabelle(v_andereStadt.stadtname) := v_entfernung;
  exit when c_städte%NOTFOUND;
END Loop;
close c_städte;
return tabelle;
end Entfernung;

```

how can i call this function in oracle. The parameter is rowtype and I cant't use SELECT function from DUAL;

Answer: 
You're looping over `set` and for each item inside a set, you're creating a new `ul` element. You need to have multiple loops where you create an `ul` and afterwards add all the `li`s for the section. I changed your data structure, you don't need the `set` properties (and they're overriding each other as property names are unique). `basic` is now an array which consists of arrays which represent a `set`.

```js
var data = {
    "ebooks": {
        "basic": [
            [
                {
                    "title": "PDF Sample 1",
                    "product_id": 1,
                    "type": "ebook"
                },
                {
                    "title": "PDF Sample 2",
                    "product_id": 2,
                    "type": "ebook"
                },
            ],
            [
                {
                    "title": "PDF Sample 3",
                    "product_id": 1,
                    "type": "ebook"
                },
                {
                    "title": "PDF Sample 4",
                    "product_id": 2,
                    "type": "ebook"
                },
            ]
        ]
    }
}

data.ebooks.basic.forEach(function(set) {
    var $list = $('<ul></ul>');

    set.forEach(function(pdf) {
        $list.append('<li>' + pdf.title +  '</li>')
    });

    $('#ebook').append($list);
});
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="ebook"></div>
```
Your problem is use $('#ebook ul'), another question, why you use the key "set" two times? No make sense, 

```
var data = {
"ebooks": {
    "basic": [
        [
            {
                "title": "PDF Sample 1",
                "product_id": 1,
                "type": "ebook"
            },
            {
                "title": "PDF Sample 2",
                "product_id": 2,
                "type": "ebook"
            },
        ],
        [
            {
                "title": "PDF Sample 3",
                "product_id": 1,
                "type": "ebook"
            },
            {
                "title": "PDF Sample 4",
                "product_id": 2,
                "type": "ebook"
            },
        ]
    ]
}
}

$.each(data.ebooks.basic, function(i, item) {
    $('#ebook').append('<ul>'); // Append new list sets
    $.each(item, function(i, item2) {
    $('#ebook ul:last').append('<li><a href="#" data-id="' + item2.product_id + '" data-type="' + item2.type + '">' + item2.title + '</a></li>');
});
});

```

see the [fiddle](https://jsfiddle.net/efo0ug73/1/)