blob: 68f09ae8426cf98e05eb1512bf39b5fe78f3812f [file] [log] [blame]
khfaraaz82@gmail.comc526fe92012-08-10 22:09:13 +00001/*
2 * Testcase Name : startwith02.aql
3 * Description : Positive tests
4 * Success : Yes
5 * Date : 19th April 2012
6 */
7
8// Create internal dataset, insert string data into string field and pass the string field as first input to start-with function
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type TestType as {
15name:string
16}
17
18create dataset testds(TestType) partitioned by key name;
19
20insert into dataset testds({"name":"John Smith"});
21insert into dataset testds({"name":"John Doe"});
22insert into dataset testds({"name":"John Wayne"});
23insert into dataset testds({"name":"Johnson Ben"});
24insert into dataset testds({"name":"Johnny Walker"});
25insert into dataset testds({"name":"David Smith"});
26insert into dataset testds({"name":"Not a Name"});
27
28write output to nc1:"rttest/string_startwith03.adm;
29
30// Return all names that start with John
31
32for $l in dataset('testds')
33order by $l.name
34where start-with($l.name,"John")
35return $l