I'm converting a procedure from Microsoft's TSQL into Oracle's PL/SQL.
Currently, the procedure does two select queries. They look like so:
PROCEDURE procName
@system_id int,
@user_id int,
AS
SELECT lots of fields
FROM lots of tables
WHERE id = system_id
SELECT lots of different fields
FROM lots of different tables
WHERE id = system_id
That is really all there is to the TSQL procedure. Each query's selected fields are completed different to one another (not a single common column). When this procedure is called from the code, each field can be referenced and the calling program simply knows where to get the result from.
In converting it to Oracle, I've had to tinker with it. I've created two separate sys ref cursors now, one to hold the result of each query. However, how can I amalgamate these into a single result set and return them to the user?
Key info:
1. Two separate queries.
2. All fields in each query are unique (i.e. nothing in Query 1 appears in Query 2 and vice versa).
3. Need to return is as a single, flat result set.