Re: INSERT INTO and MULTI-RECORD Pls Help!

From: <times9_at_my-deja.com>
Date: 2000/06/13
Message-ID: <8i5rs2$8m5$1_at_nnrp1.deja.com>#1/1


Thank you for the help.
[Quoted] I have a PAYROLL table which has the student name, amount earned, pay [Quoted] period, year, and the social security number. What I'm trying to do is: for each student, sum up the amount earned for the pay periods for the summer semesters and the fiscal academic semesters seperately. Pay periods differ for summer and academic semesters. Then I need to display these totals in a multi-record block for summer and academic year in 2 different multi-record blocks. I wanted to do a SELECT and insert what it returns into the multi-record block, but I don't know how to insert [Quoted] into it. Oracle forms says something like, "There are too many rows returned." I thought that it would automatically insert it into the next row, but it doesn't. I tried something like this: [Quoted] There is a multi-record block called SUMMER_PAYROLL which has columns name, amount earned, social security number. And I issued:

[Quoted] select name, SUM(amount_earned), ssn
[Quoted] INTO :SUMMER_PAYROLL.name, :SUMMER_PAYROLL.amount_earned,

     :SUMMER_PAYROLL.ssn from PAYROLL
where year = 2000 and pay_period < 15;

The select will return multiple records, and I want it to populate the multi-record block SUMMER_PAYROLL. But it doesn't work. There are other conditions I have to check before it's inserted into the SUMMER_PAYROLL, but this is what I'm basically trying to do. I am [Quoted] wondering if there is a direct way to insert records into the mult-record block. For example, something like:

:SUMMER_PAYROLL[0].ssn := '2222222222';
:SUMMER_PAYROLL[1].ssn := '2323332344';
 ......
[Quoted] :SUMMER_PAYROLL[k].ssn := 'xxxxxxxxxx';

Thank you once again for any help!

> Do you just wanna throw out certain records based on a query? How
 about
> setting the default where-clause of the block then?
>
> Or you can evaluate the record when it comes back and do a
 CLEAR_RECORD?
>
> (I guess I need to know more specifics of what you're trying to do.
 Can you
> give us an example?)
>
> -Matt
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Jun 13 2000 - 00:00:00 CEST

Original text of this message