Home » SQL & PL/SQL » SQL & PL/SQL » Ref Cursor SQL*plus
Ref Cursor SQL*plus [message #201581] Sun, 05 November 2006 23:25 Go to next message
sanjit
Messages: 65
Registered: November 2001
Member
Hello ,

I have two Ref Cursor and I am calling this in my sql*plus Report by calling this portion:
SET FEEDBACK OFF
VARIABLE rc REFCURSOR
VARIABLE rc1 REFCURSOR
EXECUTE :rc := netrep_pkg.Get_lines
EXECUTE :rc1 := netrep_pkg.Get_NettingBalance
set heading ON
PRINT rc
set heading ON
PRINT rc1
SET FEEDBACK ON


The output is going to two different pages,

My qusetion is that Can I create a another Ref cusror and clubbed these two ref cusror inside..


AAA           Base_CCY        Tran_CCY         TOTAL
------------------- --------------- --------------- ----------
Bank Receipt        SGD             SGD               21189.06
IC Clearing Account SGD             SGD              -24189.06

2 rows selected.


AAA                 Base_CCY   Tran_CCY           TOTAL
------------------- --------------- --------------- ----------
Netting  To Balance SGD             SGD                  -3000

1 row selected.



My Requirement is to display like this way:
AAA           Base_CCY   Tran_CCY      TOTAL
------------------- --------------- --------------- ----------
Bank Receipt        SGD             SGD               21189.06
IC Clearing Account SGD             SGD              -24189.06

Netting  To Balance SGD             SGD                  -3000


My idea is to call these ref cursor into main cursor then how to call this??
any help would be apprecaited
Re: Ref Cursor SQL*plus [message #201597 is a reply to message #201581] Mon, 06 November 2006 00:34 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How about such a sequence:

SET heading ON
PRINT rc
SET heading OFF
PRINT rc1
SET FEEDBACK ON
Re: Ref Cursor SQL*plus [message #201598 is a reply to message #201597] Mon, 06 November 2006 00:44 Go to previous message
sanjit
Messages: 65
Registered: November 2001
Member
it is still coming in two different pages...i guess i need to set the newpagesize to 0.

Could you please suggest how to get or call these ref cursor in the another procedure ie Print_report which only calls these two ref cursor from sqlplus

Proceducre Print_Report
VARIABLE rc REFCURSOR
VARIABLE rc1 REFCURSOR
Begin
EXECUTE :rc := netrep_pkg.Get_lines
EXECUTE :rc1 := netrep_pkg.Get_NettingBalance
....
end;

then how to print this here..Is this feasible

[Updated on: Mon, 06 November 2006 00:49]

Report message to a moderator

Previous Topic: Space Printing problem...
Next Topic: PL/SQL Function
Goto Forum:
  


Current Time: Fri Dec 09 09:46:07 CST 2016

Total time taken to generate the page: 0.08715 seconds