Using stored procedure and reference cursor to extract data