RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Test cross dataverse functionality |
| 3 | * : use dataverse statement is now optional. |
| 4 | * : Use fully qualified names to access datasets. |
| 5 | * Expected Res : Success |
| 6 | * Date : 29th Aug 2012 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse student if exists; |
| 10 | drop dataverse teacher if exists; |
| 11 | |
| 12 | create dataverse student; |
| 13 | create dataverse teacher; |
| 14 | |
| 15 | write output to nc1:"rttest/cross-dataverse_cross-dv01.adm"; |
| 16 | |
| 17 | create type student.stdType as open { |
| 18 | id : int32, |
| 19 | name : string, |
| 20 | age : int32, |
| 21 | sex : string, |
| 22 | dept : string |
| 23 | } |
| 24 | |
| 25 | create type teacher.tchrType as open { |
| 26 | id : int32, |
| 27 | name : string, |
| 28 | age : int32, |
| 29 | sex : string, |
| 30 | dept : string |
| 31 | } |
| 32 | |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame^] | 33 | create dataset student.ugdstd(stdType) primary key id; |
| 34 | create dataset student.gdstd(stdType) primary key id; |
| 35 | create dataset teacher.prof(tchrType) primary key id; |
| 36 | create dataset teacher.pstdoc(tchrType) primary key id; |
RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 37 | |
| 38 | insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"}); |
| 39 | |
| 40 | insert into dataset student.gdstd({"id":418,"name":"John Smith","age":26,"sex":"M","dept":"Economics"}); |
| 41 | |
| 42 | insert into dataset teacher.prof({"id":152,"name":"John Meyer","age":42,"sex":"M","dept":"History"}); |
| 43 | |
| 44 | insert into dataset teacher.pstdoc({"id":259,"name":"Sophia Reece","age":36,"sex":"F","dept":"Anthropology"}); |
| 45 | |
| 46 | for $s in dataset('student.ugdstd') |
| 47 | for $p in dataset('teacher.prof') |
| 48 | for $a in dataset('student.gdstd') |
| 49 | for $b in dataset('teacher.pstdoc') |
| 50 | return {"ug-student":$s,"prof":$p,"grd-student":$a,"postdoc":$b} |