Query tool: is used to
a)connect to a database and perform queries
b)Connect to Erwin Model and perform queries on objects in model.
In this video, I have used the following queries.
I suggest you go through "CA Erwin Data Modeler ODBC Reporting Guide" by Erwin for understanding on the kinds of queries that we can run in Query tool.
/*List the Entity Name and table Name*/
select name,physical_name, tran(physical_name) from m0.entity
/*List the Attribute Name and Column Name*/
select name,physical_name, tran(physical_name) from m0.Attribute
/*List the Entity Name ,table Name, Attribute Name, Column Name, Data type*/
select E.Name as Logical_Ent_Name,
tran(E.Physical_name) as Table_nm,
A.name as Attrib_Name,
tran(a.physical_name) as Column_name,a.physical_data_type
from m0.entity E inner join m0.attribute A
on E.id@=A.Owner@
/*List the table Name,Column Name and Datatype*/
select
tran(E.Physical_name) as Table_nm,
tran(a.physical_name) as Column_name,a.physical_data_type
from m0.entity E inner join m0.attribute A
on E.id@=A.Owner@
![](https://i.ytimg.com/vi/CaNXkpegZqQ/maxresdefault.jpg)