I want to create a stored procedure from a very slow view. I am more comfortable doing this in sql server but I am using oracle 9 for this project.
My problem is that I am getting errors that seem to imply that I can not do what I want.
The first error implied that I cannot use select in a stored procedure without declaring variables and using 'select into' to populate them.
Question 1, can I use a select statement in an Oracle stored procedure and retrieve multiple rows?
The next error I got was that the multiple rows caused a problem and I have to use a cursor to get this multiple data.
Question 2, If I use a cursor will it allow the stored proc to return multiple rows?
Question 3, If the answers to the above are no, what alternatives do I have, basically I want something that behaves like a sql server stored procedure where you just have to type in a select statement.
Any help appreciated, simple example code would be nice, thanks.
My problem is that I am getting errors that seem to imply that I can not do what I want.
The first error implied that I cannot use select in a stored procedure without declaring variables and using 'select into' to populate them.
Question 1, can I use a select statement in an Oracle stored procedure and retrieve multiple rows?
The next error I got was that the multiple rows caused a problem and I have to use a cursor to get this multiple data.
Question 2, If I use a cursor will it allow the stored proc to return multiple rows?
Question 3, If the answers to the above are no, what alternatives do I have, basically I want something that behaves like a sql server stored procedure where you just have to type in a select statement.
Any help appreciated, simple example code would be nice, thanks.