blob: fbdcba466b61a5320ca72401dba2edf17a3400f5 [file] [log] [blame]
khfaraaz82@gmail.comc526fe92012-08-10 22:09:13 +00001/*
2 * Testcase Name : substr05.aql
3 * Description : Test substring2(string,position,position) built in function.
4 * Success : Yes
5 * Date : 19th April 2012
6 */
7
8// To test substring2 function with string data stored in an internal dataset.
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type TestType as open {
15name : string
16}
17
18create dataset testdst(TestType) partitioned by key name;
19
20insert into dataset testdst({"name":"UC Berkeley"});
21insert into dataset testdst({"name":"UC Irvine"});
22insert into dataset testdst({"name":"UC LA"});
23insert into dataset testdst({"name":"UC Riverside"});
24insert into dataset testdst({"name":"UC San Diego"});
25insert into dataset testdst({"name":"UC Santa Barbara"});
26insert into dataset testdst({"name":"UT Austin "});
27insert into dataset testdst({"name":"UT Dallas"});
28
29write output to nc1:"rttest/string_substr05.adm";
30
31for $a in dataset('testdst')
32order by $a.name
33return substring2($a.name,4,string-length($a.name));