Querying the Repository

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Managing Repository Files

You can query your Repository when you want to run some simple SELECT reports. Below is an example of a simple cross-diagram report that selects a Diagram, Sub Models in the Diagram, and Entities in each Sub Model.


Notepad blue icon 2.pngNote: Do not use the Repository for editing, deleting, or updating data. ER/Studio DA is the only application you should use for these operations.

Example

We created this example using ER/Studio Data Architect's Repository meta model. This data model is in the installed application directory: ...\Program Files\Embarcadero\ERStudio Data Architect X.X\SystemModels\Repository450MetaModel.dm1

SELECT dbo.DiagramVer.Name as "Diagram Name",

dbo.SubModelVer.Name as "Submodel Name",

dbo.EntityVer.Name as "Entity Name",

dbo.EntityVer.TableName as "Table Name"

FROM dbo.Diagram, dbo.DiagramVer, dbo.Entity, dbo.EntityVer, dbo.Model, dbo.SubModelVer, dbo.SubModel

WHERE (dbo.Entity.LatestVersionID = dbo.EntityVer.EntityVerID AND

dbo.Model.ModelID = dbo.Entity.ModelID AND

dbo.SubModel.LatestVersionID = dbo.SubModelVer.SubModelVerID AND

dbo.Model.ModelID = dbo.SubModel.ModelID AND

dbo.DiagramVer.DiagramID = dbo.Model.DiagramID AND

dbo.Diagram.LatestVersionID = dbo.DiagramVer.DiagramVerID)

See Also