Re: How to manipulate data from two data blocks? URGENT!

From: <suisum_at_ecn.ab.ca>
Date: 15 Dec 98 23:11:49 GMT
Message-ID: <3676ecb5.0_at_ecn.ab.ca>


[Quoted] Hi Jochen:

Thank you very much for your info.

Now I create a procedure to join several tables and eliminate records during processing. But the performance is slow as SUM, MAX commands.

The problem is:

I have to get the sum of a column. Based on the sum, it'll decide whether to display the record in the canvas.
e.g.

Customer_Table


Account_no Account_name
---------- ------------

    1           ABC
    2           BBC
    3           CCC

Expense_Table


Account_no expense_code Amount
---------- ------------ ------

    1            1           20
    1            2           30
    2            3           40
    2            1            5
    3            1            5


I need to show:

   The sum of the amount is greater 10. So in my case, the record CCC    should not be shown on the screen as there is no expense amount.    Also, I need to call other procedures to calculate the actual expenses total.

Jochen Van den Bossche (Jochen.Van-Den-Bossche_at_eurocontrol.be) wrote:
: suisum_at_ecn.ab.ca wrote:
: >
: > Hi all:
: >
: > I'm using form 4.5.
: >
: > I need to retrieve records in the following manner:
: >
: > 1. First pass. Retrieve all records from a table which do not exist in
: > other table.
: >
: > 2. Second pass. Only pick those records with the following conditions:
: >
: > . the tran_date in table A is less than the query date
: > entered by the user.
: >
: > OR
: > --
: > . the sum of table B + the sum of the table C
: > is greater that the query amount entered by the user.
: >
: > I have tried several solution, but no success. Such as, I want to retreive
: > all records first in a temporary block. Then, loop through the block to
: > insert data into another block. But Oracle complains taht the block is
: > empty, I can't create any record in the block.
: >
: > Any help?
: >
: > --
: > Best regards,

: Give some examples, including dummy tables and stuff.
: Maybe we can help you, but we have to understand the problem...

--
Best regards,
Received on Wed Dec 16 1998 - 00:11:49 CET

Original text of this message