blob: baa7d0b64c3c909ee48e4912254f613bf6a705f3 [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
ramangrover29669d8f62013-02-11 06:03:32 +000018create dataset testds(TestType) primary key name;
khfaraaz82@gmail.comc526fe92012-08-10 22:09:13 +000019
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
khfaraaz82@gmail.com277dab22012-09-27 00:11:06 +000028write output to nc1:"rttest/string_startwith03.adm";
khfaraaz82@gmail.comc526fe92012-08-10 22:09:13 +000029
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