Oracle stored procedure multiple resultsets
I have one oracle stored proc that will select customers based on a condition and also select all orders for customers that fulfill the requirements of the first select.
I have tried code like:
OPEN customer_cur FOR
SELECT * FROM Customer
WH开发者_如何转开发ERE Country = 'UK';
OPEN orders_cur FOR
SELECT * FROM Orders
WHERE CustomreNo in (select CustomerNo from customer_cur);
This doesn't work as you can't select from a cursor but I need a means to implement the desired behavior.
I want to return two table so that I can display a hierarchical grid to the user.
Thanks Alan.
OPEN customer_cur FOR
SELECT * FROM Customer
WHERE Country = 'UK';
OPEN orders_cur FOR
SELECT * FROM Orders, Customer
WHERE Orders.CustomreNo=Customer.CustomerNo
and Customer.Country = 'UK';
精彩评论