khfaraaz82@gmail.com | c526fe9 | 2012-08-10 22:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase Name : endwith03.aql |
| 3 | * Description : Positive tests |
| 4 | * Success : Yes |
| 5 | * Date : 20th April 2012 |
| 6 | */ |
| 7 | |
| 8 | // create internal dataset, insert string data into string field and pass the string filed as input to end-with function |
| 9 | |
| 10 | drop dataverse test if exists; |
| 11 | create dataverse test; |
| 12 | use dataverse test; |
| 13 | |
| 14 | create type TestType as { |
| 15 | name:string |
| 16 | } |
| 17 | |
| 18 | create dataset testds(TestType) partitioned by key name; |
| 19 | |
| 20 | insert into dataset testds({"name":"Jim Jones"}); |
| 21 | insert into dataset testds({"name":"Ravi Kumar"}); |
| 22 | insert into dataset testds({"name":"Bruce Li"}); |
| 23 | insert into dataset testds({"name":"Marian Jones"}); |
| 24 | insert into dataset testds({"name":"Phil Jones"}); |
| 25 | insert into dataset testds({"name":"I am Jones"}); |
| 26 | |
| 27 | write output to nc1:"rttest/string_endwith03.adm"; |
| 28 | |
| 29 | for $l in dataset('testds') |
| 30 | order by $l.name |
| 31 | where end-with($l.name,"Jones") |
| 32 | return $l |
| 33 | |