Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Implicit Cursor Problem
Do you know about the SQL*PLUS BREAK command? For example...
SQL> SELECT artist,title FROM albums;
ARTIST TITLE ------------------------------ ---------------------------------------- Boomtown Rats LoudMouth Boomtown Rats A Tonic For The Troops Kraftwerk The Man Machine Johnny Nash I Can See Clearly Now
SQL> BREAK ON artist
SQL> /
ARTIST TITLE ------------------------------ ---------------------------------------- Boomtown Rats LoudMouth A Tonic For The Troops Kraftwerk The Man Machine Johnny Nash I Can See Clearly Now
SQL> BREAK ON artist SKIP 2
SQL> /
ARTIST TITLE ------------------------------ ---------------------------------------- Boomtown Rats LoudMouth A Tonic For The Troops Kraftwerk The Man Machine Johnny Nash I Can See Clearly Now
SQL> BREAK ON artist SKIP PAGE
SQL> /
ARTIST TITLE ------------------------------ ---------------------------------------- Boomtown Rats LoudMouth A Tonic For The Troops ARTIST TITLE ------------------------------ ---------------------------------------- Kraftwerk The Man Machine ARTIST TITLE ------------------------------ ---------------------------------------- Johnny Nash I Can See Clearly Now
SQL> Hope this helps!
Rich Woodland
Magic Interface, Ltd.
Tajdar Jawaid wrote:
> This is the Query
>
> SELECT SUBSTR(RECEIPT_NO,1,10) RECEIPT,
> SUBSTR(RECEIPT_ACCOUNT_NO,1,10) CUSTOMER,
> SUBSTR(RECEIPT_FIRST||' '||RECEIPT_LAST,1,25) NAME,
> SUBSTR(RECEIPT_PACKAGE,1,15) PACK,
> SUBSTR(RECEIPT_PAYMENT_MODE,1,10) PAYMODE,
> SUBSTR(RECEIPT_K_CODE,1,15) DES,
> SUBSTR(RECEIPT_TAX,1,1) TAX,
> SUBSTR(RECEIPT_AMOUNT,1,10) AMOUNT
> FROM RECEIPT_DETAIL_T
> WHERE TRUNC(CYB_DATE_CONVERTER(CREATED_T))='22-MAY-00'
> AND RECEIPT_PACKAGE='Corporate'
>
> and this is the result
>
> RECEIPT CUSTOMER NAME PACK
> PAYMODE DES
> T AMOUNT
> ---------- ---------- ------------------------- ---------------
> ---------- --------------- -
> -------
> 196863 1071371 Samad Works (Pvt) Ltd. Corporate
> cash II 2400
> 196863 1071371 Samad Works (Pvt) Ltd. Corporate
> cash ss 1200
> 196869 1055228 Aqeel Pervaiz Corporate
> check II 5176
> 196929 1054900 Abdul Razzak Jangda Corporate
> check II 8708
> 197007 1071439 PR News Corporate
> cash II 2400
> 197007 1071439 PR News Corporate
> cash ss 1200
>
> but I want the result like this
>
> RECEIPT CUSTOMER NAME PACK
> PAYMODE DES
> T AMOUNT
> ---------- ---------- ------------------------- ---------------
> ---------- --------------- -
> -------
> 196863 1071371 Samad Works (Pvt) Ltd. Corporate
> cash II 2400
>
> cash ss 1200
> ----------------------------------------------------------------------------------------------------
>
> Total:
> 3600
> ----------------------------------------------------------------------------------------------------
>
> 196869 1055228 Aqeel Pervaiz Corporate
> check II 5176
> ----------------------------------------------------------------------------------------------------
>
> Total:
> 5176
> ----------------------------------------------------------------------------------------------------
>
> 196929 1054900 Abdul Razzak Jangda Corporate
> check II 8708
> ----------------------------------------------------------------------------------------------------
>
> Total:
> 8708
> ----------------------------------------------------------------------------------------------------
>
> 197007 1071439 PR News Corporate
> cash II 2400
>
> cash ss 1200
> ----------------------------------------------------------------------------------------------------
>
> Total:
> 3600
> ----------------------------------------------------------------------------------------------------
>
> ----------------------------------------------------------------------------------------------------
>
> Grand Total:
> 21084
> ----------------------------------------------------------------------------------------------------
>
> If the customer is same then just get his second payment mod,description
> and amount and his
> total;
>
> If you have some solution in PL/SQL or SQl
>
> then I m waiting
>
> Regards
>
> Tajdar Jawaid
Received on Wed May 31 2000 - 00:00:00 CDT