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!

Multiple select statements in PL/SQL

720040Sep 17 2009 — edited Oct 8 2009
Hi All

I am new to PL/SQL and my experience is in writing TSQL. There we can write a SQL statement like this to return 3 result set

SELECT empname FROM Employee
SELECT authname FROM Author
SELECT athname FROM sport

how can we write the same 3 statements in PL/SQL and attain the 3 resultsets.
I tried to implement the same using PL/SQL anonymous blocks. But it didn't worked.


DECLARE
P_RECORDSET OUT SYS_REFCURSOR
BEGIN
OPEN P_RECORDSET FOR
SELECT empname FROM Employee;
SELECT authname FROM Author;
SELECT athname FROM sport;
END;

can anybody show how it can be done.

Thanks in advance
George

Edited by: user6290570 on Sep 16, 2009 11:23 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2009
Added on Sep 17 2009
18 comments
21,155 views