If using it for such a query I would agree, however it allows a single
DB roundtrip for something such as inserting into the main table and
then the various link tables as well.  We typically will insert the
NEXTVAL of a sequence in the first INSERT section and then use
CURRVAL of the same sequence that we inserted into the main table for
all the rest of the link tables.

Example:
INSERT ALL INTO
PERSON
(PERSON_ID, OTHER_STUFF)
VALUES
(PERSON_ID_SEQUENCE.NEXTVAL, OTHER_VALS)
INTO
PERSON_ORG_LNK_TABLE
(PERSON_ID, ORG_ID)
VALUES
(PERSON_ID_SEQUENCE.CURRVAL, ORG_ID)

On Nov 26, 8:34 am, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> I will add a feature request, however I don't think this is something
> that many people use or need. It's an Oracle specific feature I
> couldn't find in any other database. Most databases however support
> the much shorter:
>
> INSERT ALL
> INTO phone_book VALUES ('John Doe', '555-1212'), ('Peter Doe', '555-2323');
>
> instead of the Oracle syntax:
>
> INSERT ALL
> INTO phone_book VALUES ('John Doe', '555-1212')
> INTO phone_book VALUES ('Peter Doe', '555-2323')
> SELECT * FROM DUAL;
>
> Regards,
> Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to