Re: And again: 1NF may not be dead

From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Mon, 08 Nov 2004 10:25:08 -0500
Message-ID: <knf462-prv.ln1_at_pluto.downsfam.net>


Tony Andrews wrote:

> Kenneth Downs wrote:
>> Tony Andrews wrote:
>>
>> > Oracle has this syntax in its procedural extension to SQL (PL/SQL):
>> >
>> > FORALL i IN 1..ArrayExample.COUNT
>> > INSERT INTO CHILDREN (parent_id,item_id)
>> > SELECT 'X',ArrayExample(i);
>> > I don't know whether standard SQL has an equivalent.
>>
>> no good, you have a procedural loop. The OP is a wishlist item, so
> it gets
>> to stay pure. The pure expression is a single command that inserts
> the
>> entire array in one smack.
>>
>> It does what you mean, perl-style.
>
> Don't be fooled by the loop-ish keyword name, this is NOT the same as:
>
> FOR i IN 1..ArrayExample.COUNT LOOP
> INSERT INTO CHILDREN (parent_id,item_id)
> SELECT 'X',ArrayExample(i);
> END LOOP;
>
> The former is a bulk operation, the latter is N single operations.
>
> More details are available here:
>
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#28181

After the FORALL, can I put a statement block, or only one command?

-- 
Kenneth Downs
Use first initial plus last name at last name plus literal "fam.net" to
email me
Received on Mon Nov 08 2004 - 16:25:08 CET

Original text of this message