How to sort an associative array in PL/SQL?

后端 未结 2 635
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 08:30

I have an associative array like this:

continent_population(\'Australia\') := 30;
continent_population(\'Antarctica\') := 90;
continent_population(\'UK\') :=         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 08:36

    The accepted answer is outdated. Since Oracle 12c, querying associative arrays using the TABLE operator is possible, as long as the type is declared in a package spec: https://galobalda.wordpress.com/2014/08/02/new-in-oracle-12c-querying-an-associative-array-in-plsql-programs/

    You can sort an associative array by values, and you don't have to convert the data: Sorting an index-by table (associative array)

提交回复
热议问题