Hi, I'm fairly new to Oracle, although I've used SQL Server for years.
I'm currently producing a horrible little Crystal report where I'll need to pass parameters to a sql function and have it return the data I need -- Not just a value or a row but 10 or 12 rows.
Now with SQL server it was pretty easy to write a function, without having to come to grips with any nasty cursors, and have it return a table: Just pop in your query, add a header for the parameters and get it to return the results of your query. Not much more than a fancy view.
If only the same were true of Oracle.
By playing with a few examples I've worked out how to write simple cursors which return rowtypes, but that's where I've hit a brick wall.
So my question is this, how can I write a function to pass a few parameters and which will then return multiple rows, without having to become a PL/SQL cursor wizard overnight? Is there an easy and obvious solution that I am missing?
I'm currently producing a horrible little Crystal report where I'll need to pass parameters to a sql function and have it return the data I need -- Not just a value or a row but 10 or 12 rows.
Now with SQL server it was pretty easy to write a function, without having to come to grips with any nasty cursors, and have it return a table: Just pop in your query, add a header for the parameters and get it to return the results of your query. Not much more than a fancy view.
If only the same were true of Oracle.
By playing with a few examples I've worked out how to write simple cursors which return rowtypes, but that's where I've hit a brick wall.
So my question is this, how can I write a function to pass a few parameters and which will then return multiple rows, without having to become a PL/SQL cursor wizard overnight? Is there an easy and obvious solution that I am missing?