Toad World® Forums

create subtotal from budget and usage transactions

Hi, newbie want to ask.

I’m want to create a report in oracle 11g, i need a subtotal and grand total.

My sql query data :

SOURCE_
PR NO
AMOUNT
DESC
BUDGET
NULL
2,000,000
BEG BUDGET
APPROVED PR
PR NO 1
-900,000
FOOD
APPROVED PR
PR NO 3
-500,000
ENTERTAIN
And i want to create PL/SQL Report to access from oracle 11g looks like this :

SOURCE_
PR NO
AMOUNT
DESC
BUDGET
NULL
2,000,000
BEGIN BUDGET
SUBTOTAL
2,000,000
APPROVED PR
PR NO 1
-900,000
FOOD
PR NO 3
-500,000
ENTERTAIN
SUBTOTAL
-1,400,000
GRAND TOTAL (LEFT BUDGET)
600,000
I usually create oracle procedure using this code, and running in TOAD 4 Oracle :

CREATE OR REPLACE PROCEDURE APPS.<Proc_Name>

()

IS

and so on.

Already using BREAK ON AND COMPUTE in SQL Statement, but got warning, and cant compile it.

Im putting BREAK ON Source_ ON REPORT before Select statment. (When not in create proc, the query is fine).

Still want to use Break n Compute, any suggest where to put those. Or any better ideas.

And if u can, im already create Toad Report in Toad for analysts for such report, how to embed with my oracle 11g?

Thanks before.