| /* |
| * Description : Test cross dataverse functionality |
| * : use dataverse statement is now optional. |
| * : Use fully qualified names to create datasets, types and query Metadata to verify. |
| * Expected Res : Success |
| * Date : 28th Aug 2012 |
| */ |
| |
| drop dataverse student if exists; |
| drop dataverse teacher if exists; |
| |
| create dataverse student; |
| create dataverse teacher; |
| |
| write output to nc1:"rttest/cross-dataverse_cross-dv02.adm"; |
| |
| create type student.stdType as open { |
| id : int32, |
| name : string, |
| age : int32, |
| sex : string, |
| dept : string |
| } |
| |
| create type teacher.tchrType as open { |
| id : int32, |
| name : string, |
| age : int32, |
| sex : string, |
| dept : string |
| } |
| |
| create dataset student.ugdstd(stdType) primary key id; |
| create dataset student.gdstd(stdType) primary key id; |
| create dataset teacher.prof(tchrType) primary key id; |
| create dataset teacher.pstdoc(tchrType) primary key id; |
| |
| insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"}); |
| |
| insert into dataset student.gdstd({"id":418,"name":"John Smith","age":26,"sex":"M","dept":"Economics"}); |
| |
| insert into dataset teacher.prof({"id":152,"name":"John Meyer","age":42,"sex":"M","dept":"History"}); |
| |
| insert into dataset teacher.pstdoc({"id":259,"name":"Sophia Reece","age":36,"sex":"F","dept":"Anthropology"}); |
| |
| for $l in dataset('Metadata.Dataset') |
| where $l.DataverseName='student' or $l.DataverseName='teacher' |
| return $l |