| * Testcase Name : startwith02.aql |
| * Description : Positive tests |
| // Create internal dataset, insert string data into string field and pass the string field as first input to start-with function |
| drop dataverse test if exists; |
| create type TestType as { |
| create dataset testds(TestType) partitioned by key name; |
| insert into dataset testds({"name":"John Smith"}); |
| insert into dataset testds({"name":"John Doe"}); |
| insert into dataset testds({"name":"John Wayne"}); |
| insert into dataset testds({"name":"Johnson Ben"}); |
| insert into dataset testds({"name":"Johnny Walker"}); |
| insert into dataset testds({"name":"David Smith"}); |
| insert into dataset testds({"name":"Not a Name"}); |
| write output to nc1:"rttest/string_startwith03.adm"; |
| // Return all names that start with John |
| for $l in dataset('testds') |
| where start-with($l.name,"John") |