Finding studyDataset table 'prefix' for Dev purposes

LabKey Support Forum (Inactive)
Finding studyDataset table 'prefix' for Dev purposes dennisw  2017-09-21 10:38
Status: Closed
 
Preface: I make it a practice to never develop any code that relies on directly querying the underlying LK database and instead use the API.

However, I'm working on a small project and during the initial stage it would be helpful to be able to easily tell what study or container is correlated to the hex prefixes on the dataset tables in the database. For instance, how do I figure out what study or container the db table studyDataset.c111d5322_demographics belongs to (other than by looking inside the table)?
 
 
Jon (LabKey DevOps) responded:  2017-09-21 14:15
Hi Dennis,

If you go into your DB and check the table "exp.domaindescriptor", that should have a column called "storagetablename" that corresponds with the specific tables under the studydataset schema and any of the other schemas that use that alphanumeric combo before the table name.

Regards,

Jon
 
jeckels responded:  2017-09-21 14:18
Hi Dennis,

The number after the 'c' and before the 'd' in the table name is the RowId of the container record, in decimal.

There's a semi-secret way to resolve this to the container - you can use "__rX" as the container name in a URL to get to the container with RowId X.

For example:

http://localhost:8080/labkey/project/__r111/begin.view?

would take you to the container for your demographics dataset.

Thanks,
Josh