Skip to Content

Querying the PD Repository

I need help; or, I need help finding help... I want to query my PD Repository database to answer questions about the "health" of our models. I have explored the Repository Data Model, but am struggling still. I want to answer questions like: Within a certain Repository folder, including sub-folders, within all current-version physical data models, how many tables have non-empty comments? (And, similarly, for columns.)


I've figured out bits and pieces - but only at the highest level, for example:

select count(*) from PMOBJT where CLSS=272 and cmmt<>0 and lvrs=1; -- number of latest version tables with a comment

What I have not figured out is how to determine how objects are related to each other - folders within folders, PDM's within folders, tables with PDMs, columns within PDMS.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 09 at 09:12 PM

    You might have seen this already, but there is a published metamodel that explains all of the relationships between the tables. I found this one:

    http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38628.1600/doc/html/rad1232022065342.html.

    Look at the "MetaModel.oom" file. It should give you more help also.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Michael,

      First of all, thanks for sharing this, I had no idea about this metamodel and it's being very helpful.

      Ive noticed that my Metamodel version is 16.6.3 and my PD version is 16.6.4.2.

      ¿How can I get updated metamodel? The 16.6.3 one is on my instalation/Examples path

      thanks!

      Anna

  • Jan 09 at 09:20 PM

    In the script you could check out the model in memory then navigate it in the usual way

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 22 at 08:20 PM

    To follow up... The key was in knowing how to write hierarchical queries. I still don't know how, really, but a teammate does, and helped me out.

    Add comment
    10|10000 characters needed characters exceeded