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