issue with cross-folder query?

LabKey Support Forum (Inactive)
issue with cross-folder query? Ben Bimber  2010-03-15 16:40
Status: Closed
 
I have a folder with a list located here:

Project: WNPRC
Folder path: /WNPRC_Units/Animal_Services/Compliance_Training/EmployeeDB
schema: lists
QueryName: Employees
Full URL (in case i'm interpreting wrong):
http://localhost:8080/labkey/list/WNPRC/WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/grid.view?listId=68

I want to query this list from the following folder:
WNPRC/WNPRC_Units/Animal_Services/Compliance_Training/Public/

Here is my query:

SELECT
e.PersonID
FROM WNPRC."WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/".lists.Employees e

According to the documentation here:
https://www.labkey.org/wiki/home/Documentation/page.view?name=crossFolderQueries

This seems right. Project is WNPRC, path relative to the project is quoted, schema is lists and table is Employees. I get an error:

There was an error while parsing this query: Error on line 3:Table WNPRC.WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/.lists.Employees not found.

Is there something I'm doing wrong? Can I only query study data cross-folder?

thanks for any help.
 
 
Matthew Bellew responded:  2010-03-15 16:44
This is a little confusing. In the documentation "Project" literally means the word "Project" as an alias for the current project. Since you have a fully qualified path (to a different project) you want


SELECT
e.PersonID
FROM "/WNPRC/WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/".lists.Employees e
 
jeckels responded:  2010-03-15 16:46
Hi Ben,

In this case, the first identifier should be Project, not WNPRC. It resolves to the current folder's project, and is always called Project.

SELECT
e.PersonID
FROM Project."WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/".lists.Employees e

In 10.1, we introduced a new cross-project syntax that would also work for you. To use it, you'd write a query like this:

SELECT
e.PersonID
FROM "/WNPRC/WNPRC_Units/Animal_Services/Compliance_Training/Private/EmployeeDB/".lists.Employees e

Thanks,
Josh
 
Ben Bimber responded:  2010-03-15 16:48
got it. thanks.