khfaraaz82@gmail.com | 2b68472 | 2012-07-26 19:58:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Insert from source dataset into target dataset |
| 3 | * Expected Result : Success |
| 4 | * Date : 25th July 2012 |
| 5 | * Issue # : Issue 76 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse testdv2 if exists; |
| 9 | create dataverse testdv2; |
| 10 | use dataverse testdv2; |
| 11 | |
| 12 | write output to nc1:"rttest/dml_insert-src-dst-01.adm"; |
| 13 | |
| 14 | create type testtype01 as closed { |
| 15 | id: string, |
| 16 | name: string? |
| 17 | } |
| 18 | |
| 19 | create type testtype02 as closed { |
| 20 | id: string |
| 21 | } |
| 22 | |
| 23 | create dataset testds01(testtype01) partitioned by key id; |
| 24 | create dataset testds02(testtype02) partitioned by key id; |
| 25 | |
| 26 | insert into dataset testds01 ({ "id": "001" }); |
| 27 | insert into dataset testds01 ({ "id": "002", "name": "John Doe" }); |
| 28 | |
| 29 | insert into dataset testds02 ({ "id": "003" }); |
| 30 | insert into dataset testds02 ({ "id": "004" }); |
| 31 | insert into dataset testds02 ({ "id": "005" }); |
| 32 | |
| 33 | insert into dataset testds01( |
| 34 | for $d in dataset("testds02") |
| 35 | return $d |
| 36 | ); |
| 37 | |
| 38 | for $d in dataset("testds01") |
| 39 | order by $d.id |
| 40 | return $d |