blob: b31fe8864da15e3294d5d329cf1948fc2fecddf4 [file] [log] [blame]
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +00001/*
2 * Testcase Name : c2c-wo-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 * : Note that the optional field in source dataset does not hold any data.
7 * Success : Yes
8 * Date : 23rd May 2012
9 */
10
11drop dataverse test if exists;
12create dataverse test;
13use dataverse test;
14
15create type TestType as closed {
16id:int32,
17description:string,
18name:string,
19optnl_fld:string?
20}
21
ramangrover29669d8f62013-02-11 06:03:32 +000022create dataset T1(TestType) primary key id;
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +000023
ramangrover29669d8f62013-02-11 06:03:32 +000024create dataset T2(TestType) primary key id;
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +000025
26insert into dataset T1({
27"id":1234,
28"description":"donut",
29"name":"Cake"
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