blob: c5fb80c16af41ee9aad1998f759d83f4597ac643 [file] [log] [blame]
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +00001/*
2 * Testcase Name : c2c-w-optional.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 * : The schema includes one optional field named optnl_fld.
6 * Success : Yes
7 * Date : 23rd May 2012
8 */
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type TestType as closed {
15id:int32,
16description:string,
17name:string,
18optnl_fld:string?
19}
20
ramangrover29669d8f62013-02-11 06:03:32 +000021create dataset T1(TestType) primary key id;
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +000022
ramangrover29669d8f62013-02-11 06:03:32 +000023create dataset T2(TestType) primary key id;
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +000024
25insert into dataset T1({
26"id":1234,
27"description":"donut",
28"name":"Cake",
29"optnl_fld":"optional data goes here"
30}
31);
32
33insert into dataset T2(for $l in dataset("T1") return $l );
34
35for $d in dataset("T2")
36order by $d.id
37return $d