Q

Sorting an array

Is there an easy way to sort a PL/SQL table (i.e. array)? I'm storing memberIDs and dollars accrued and need to write a file showing each member and their total account balance. I'm populating the PL/SQL table from three different cursors (can't combine into one), and wanted to sort the table by member to do the summing of accrued dollars.
Not really. However, starting with Oracle8i you can use something called GLOBAL Temporary Table. You can specify whether to preserve or delete the rows on commit.

The advantage is that the data in GLOBAL Temporary Table is available only during the session and you can even index the global temporary table and sort it using normal select statements.

This was first published in March 2004

Dig deeper on Using Oracle PL-SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close