blob: 58548b697ede1447b56389b377df0c1a96eeeab4 [file] [log] [blame]
alexander.behm048a2a32012-05-03 06:18:56 +00001/*
2 * Test case Name : insert-into-empty-dataset.aql
3 * Description : Check that we can insert into an empty dataset
4 * Expected Result : Success
5 * Date : May 2 2012
6 */
7
vinayakb38b7ca42012-03-05 05:44:15 +00008drop dataverse test if exists;
vinayakb38b7ca42012-03-05 05:44:15 +00009create dataverse test;
10use dataverse test;
11
12create type LineIDType as closed {
13 l_orderkey: int32,
14 l_linenumber: int32,
15 l_suppkey: int32
16}
17
vinayakb38b7ca42012-03-05 05:44:15 +000018create dataset LineID(LineIDType)
ramangrover29669d8f62013-02-11 06:03:32 +000019 primary key l_orderkey, l_linenumber;
vinayakb38b7ca42012-03-05 05:44:15 +000020
vinayakb38b7ca42012-03-05 05:44:15 +000021insert into dataset LineID (
22let $x:=1
23let $y:=2
24let $z:=3
25return {
26 "l_orderkey": $x,
alexander.behm8ebed0d2012-05-04 00:05:52 +000027 "l_linenumber": $y,
vinayakb38b7ca42012-03-05 05:44:15 +000028 "l_suppkey": $z
29}
30);
31
32insert into dataset LineID (
33let $x:=2
34let $y:=3
35let $z:=4
36return {
37 "l_orderkey": $x,
alexander.behm8ebed0d2012-05-04 00:05:52 +000038 "l_linenumber": $y,
vinayakb38b7ca42012-03-05 05:44:15 +000039 "l_suppkey": $z
40}
41);
42
alexander.behmc05489d2012-05-04 01:26:41 +000043write output to nc1:"rttest/dml_insert-into-empty-dataset.adm";
vinayakb38b7ca42012-03-05 05:44:15 +000044for $c in dataset('LineID')
45where $c.l_suppkey < 100 and $c.l_linenumber<5
46order by $c.l_orderkey, $c.l_linenumber
47return $c