Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how do i do a select on results of a stored procedure?

1039135Sep 11 2013 — edited Sep 16 2013

Hello,

I'm new to Oracle. I'm working in SQL Developer.

I'm trying to do a simple select on the results of a stored procedure call. I'm not sure how to do it. Here's what I've got so far:

declare
type ref_cursor is ref cursor;
results ref_cursor;
begin
MyStoredProcedure(123, results);
select * from results;
end;
/

but it tells me:

Error starting at line 1 in command:
declare
type ref_cursor is ref cursor;
results ref_cursor;
begin
GET_TAX_TYPE_BY_TAX_ENTITY_KEY(60670100000000, results);
select * from results;
end;
Error report:
ORA-06550: line 6, column 15:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 6, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

Obviously, select * from results; is not the right way to do it. But what is?

Thanks for any forthcoming advice.

This post has been answered by Billy Verreynne on Sep 13 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2013
Added on Sep 11 2013
14 comments
7,334 views