Re: INSERT INTO and MULTI-RECORD Pls Help!

From: Stefan Leugers <Stefan.Leugers_at_t-online.de>
Date: 2000/06/13
Message-ID: <3946984C.8C38B2A5_at_t-online.de>#1/1


Hello Matt,

you cannot assign this statement

>
> select name, SUM(amount_earned), ssn
> INTO :SUMMER_PAYROLL.name, :SUMMER_PAYROLL.amount_earned,
> :SUMMER_PAYROLL.ssn from PAYROLL
> where year = 2000 and pay_period < 15;

to a multi-record block, because the statement returns - as you said - more than one record, but the assigned item is just the actual record of the multi-record block and not - as you seem to think of - the whole multi-record block. There are several solutions to your problem. You may populate a group with your statement and put each line of the group into the multi-record block using a "for rec in recordgroup" and a next_record. But you can also use the payroll table as base table and insert the sums by a select into statement in the post-query-trigger of the block.

> I am
> 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';
 ......
> :SUMMER_PAYROLL[k].ssn := 'xxxxxxxxxx';
>

No that is not possible directly. The only possibility is to use the go_record or next_record in the multi-record block and insert the values by assigning them
manually, for example :SUMMER_PAYROLL.ssn := 'xxxxxxxxxx';

Stefan Leugers
stefan.leugers_at_t-online.de Received on Tue Jun 13 2000 - 00:00:00 CEST

Original text of this message