khfaraaz82@gmail.com | 6621b1d | 2012-05-25 07:26:35 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase Name : c2c.aql |
| 3 | * Description : Insert data into target datase by doing a select on source dataset. |
| 4 | * : Here both source and target datasets are internal datasets |
| 5 | * Success : Yes |
| 6 | * Date : 23rd May 2012 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse test if exists; |
| 10 | create dataverse test; |
| 11 | use dataverse test; |
| 12 | |
| 13 | create type TestType as closed { |
| 14 | id:int32, |
| 15 | description:string, |
| 16 | name:string |
| 17 | } |
| 18 | |
| 19 | // source dataset |
| 20 | create dataset T1(TestType) partitioned by key id; |
| 21 | |
| 22 | // target dataset |
| 23 | create dataset T2(TestType) partitioned by key id; |
| 24 | |
| 25 | insert into dataset T1({ |
| 26 | "id":1234, |
| 27 | "description":"donut", |
| 28 | "name":"Cake" |
| 29 | } |
| 30 | ); |
| 31 | |
| 32 | insert into dataset T2(for $l in dataset("T1") return $l ); |
| 33 | |
| 34 | for $d in dataset("T2") |
| 35 | order by $d.id |
| 36 | return $d |