khfaraaz82@gmail.com | c526fe9 | 2012-08-10 22:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Test string-length(string) function |
| 3 | * Expected Res : Success |
| 4 | * Date : 19th April 2012 |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | // Create internal dataset, insert string data and pass the string attribute to string-length function, and verify results. |
| 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":"Maradona"}); |
| 21 | insert into dataset testds({"name":"Pele"}); |
| 22 | insert into dataset testds({"name":"Roberto Baggio"}); |
| 23 | insert into dataset testds({"name":"Beckham David"}); |
| 24 | insert into dataset testds({"name":"Rooney"}); |
| 25 | insert into dataset testds({"name":"Ronaldinho"}); |
| 26 | insert into dataset testds({"name":"Ronaldo"}); |
| 27 | insert into dataset testds({"name":"Zinadine Zidane"}); |
| 28 | insert into dataset testds({"name":"Cristiano Ronaldo"}); |
| 29 | insert into dataset testds({"name":"Messi"}); |
| 30 | insert into dataset testds({"name":"Tevez"}); |
| 31 | insert into dataset testds({"name":"Henry"}); |
| 32 | |
| 33 | write output to nc1:"rttest/string_strlen03.adm"; |
| 34 | |
| 35 | for $l in dataset('testds') |
| 36 | order by $l.name |
| 37 | return string-length($l.name) |