2013/6/17 Cecil Westerhof <[email protected]>:
> 2013/6/17 Noel Grandin <[email protected]>:
>> Something like (completely untested)
>>
>> INSERT INTO types (typeID, description, typeGroupID)
>> SELECT v.C1, v.C2, typeGroups.typeGroupID
>> FROM (VALUES (RANDOM_UUID(), 'Evaluate'), (RANDOM_UUID(), 'Templates')),
>>             typeGroups
>> WHERE  typeGroups.description = 'Stay on Track';
>>
>> Where you can use VALUES like a table, see:
>> http://h2database.com/html/grammar.html#values_expression
>
> I tried it and several variants, but until now I did not get it working.

The problem was with the RANDOM_UUID(). The following does work:
    INSERT INTO types (typeID, description, typeGroupID)
    SELECT      c1, c2, typeGroupID
    FROM       (VALUES  ('417e9d29-080c-4519-87e7-10d914dfd507', 'Evaluate'),
                        ('4025ddf9-186a-4197-8a1d-23b7789bd4b3', 'Templates')),
               typeGroups
    WHERE      description = 'Stay on Track'
    ;

-- 
Cecil Westerhof

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to