Re: And again: 1NF may not be dead
From: --CELKO-- <jcelko212_at_earthlink.net>
Date: 4 Nov 2004 19:15:29 -0800
Message-ID: <18c7b3c2.0411041915.7dad2782_at_posting.google.com>
Date: 4 Nov 2004 19:15:29 -0800
Message-ID: <18c7b3c2.0411041915.7dad2782_at_posting.google.com>
>> What I'd like is some kind of SQL command that splits arrays and
We have it with the table constructor in SQL-92. You just need to
pass each array elment to a VALUES() clause:
INSERT INTO Foobar VALUES ((:a[1]), (:a[2]),..(:a[100]));
You can get a little fancier with an array records in the host
language, and you can be safe with a little extra code:
INSERT INTO Foobar
lists into multiple inserts, .. Perhaps Mr. Celko can jump in and tell
us if things like this are unde r consideration at all. <<
SELECT DISTINCT x
FROM VALUES ((:a[1]), (:a[2]),..(:a[100])) AS InputList(x)
WHERE x IS NOT NULL -- possible rule
--CELKO-- Received on Fri Nov 05 2004 - 04:15:29 CET