khfaraaz82@gmail.com | c526fe9 | 2012-08-10 22:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Test case Name : strconcat01.aql |
| 3 | * Description : Test string-concat([string]) function. |
| 4 | * : Pass the strings(which are in internal dataset) to string-concat function for concatenation. |
| 5 | * Success : Yes |
| 6 | * Date : 16th April 2012 |
| 7 | */ |
| 8 | |
| 9 | |
| 10 | drop dataverse test if exists; |
| 11 | create dataverse test; |
| 12 | use dataverse test; |
| 13 | |
| 14 | create type TestType as open{ |
| 15 | id:int32, |
| 16 | fname:string, |
| 17 | lname:string |
| 18 | } |
| 19 | |
| 20 | create dataset testds(TestType) partitioned by key id; |
| 21 | |
| 22 | // insert string data into internal dataset testds into the name attribute |
| 23 | |
| 24 | insert into dataset testds({"id":123,"fname":"John","lname":"Smith"}); |
| 25 | insert into dataset testds({"id":124,"fname":"Bob","lname":"Jones"}); |
| 26 | insert into dataset testds({"id":125,"fname":"Mike","lname":"Carey"}); |
| 27 | insert into dataset testds({"id":126,"fname":"Chen","lname":"Li"}); |
| 28 | insert into dataset testds({"id":121,"fname":"Young Seok","lname":"Kim"}); |
| 29 | insert into dataset testds({"id":122,"fname":"Alex","lname":"Behm"}); |
| 30 | insert into dataset testds({"id":127,"fname":"Raman","lname":"Grover"}); |
| 31 | insert into dataset testds({"id":128,"fname":"Yingyi","lname":"Bu"}); |
| 32 | insert into dataset testds({"id":129,"fname":"Vinayak","lname":"Borkar"}); |
| 33 | |
| 34 | write output to nc1:"rttest/string_strconcat01.adm"; |
| 35 | |
| 36 | for $l in dataset('testds') |
| 37 | order by $l.id |
| 38 | return { "Full Name": string-concat([$l.fname,$l.lname]) } |