Home > database >  The oracle stored procedure once return multiple times the query results
The oracle stored procedure once return multiple times the query results

Time:09-30

A stored procedure requires a return multiple query result set,
For example: the first query results AA BB CC
Zhang SAN 20 mathematical
The second query results AA BB CC
Bill 23 Chinese
The third query results AA BB CC
Fifty 23 mathematical
Every time the query is complicated not a query out zhang SAN, li si, the result of fifty, need a person in the process of storing a query, and the results according to the following format again return results AA BB CC
Zhang SAN 20 mathematical
Bill 23 Chinese
Fifty 23 mathematics,
Online search query, return multiple results are: 1. The application of cursor sys_refcursor, but don't know the cursor can insert the data for many times, if there is a great god give directions,
2. Using a temporary table in the process of storage, an example of a lot of online is essentially a writing, didn't find writing example of an oracle, a great god teach patience,

What a great god will deal with it, a great god, please give an example for the younger brother study research, thank you, a great god is great advice,

CodePudding user response:

Define a type, return to this type

CodePudding user response:

Two out parameters, can be returned two cursor,

CodePudding user response:

Use sys_refcursor, first put many times query results in a table, then the cursor read data from the table, return the cursor
  • Related