|
|
|
Re: getting total and single name in one query [message #599857 is a reply to message #599853] |
Tue, 29 October 2013 09:56 |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
sss111ind wrote on Tue, 29 October 2013 15:34Thanks Michel,
But how your example will fit in the above procedure.
Because dept count and ename are needed at same time.
When I put rownum=1 it is giving only dept count as 1 and ename is getting.
when I remove rownum then exact return more rows error getting.
What is wrong with a single query as Michel demonstrated?
If you insist on using PL/SQL, what shall be the result set? How many rows shall it contain?
If it shall contain one row, just add and extra filter on that row (which one?) to the outer query over the Michel's one.
If it shall contain all rows, use cursor loop or (maybe better) bulk collect them into the collection variable.
As DBMS_OUTPUT is not destined to "get" the result set (it just fills the internal buffer) and I have no idea what is the result set used for, it is impossible for me to propose anything.
|
|
|
|
|