Reporting > Querying the repository with 3rd-party tools > Flattener (Normalized Table Builder) > Example SQL queries
  
Example SQL queries
The following SQL query was written by hand to report on who created all of the data elements in the encyclopedia:
select entity.name, property.propname, property.propvalueshort
  from entity, property
  where (entity.class = 3 and entity.type = 15) and entity.id = property.propid and property.propname = 'Initial Audit'
The following SQL reports on all objects whose description property is exactly 255 characters and does not end in a period:
select class, type, name
  from entity
  where id in (select propid from property where propname = 'Description' and len(propvalueshort) = 255 and right(propvalueshort, 1) <> '.')
To run these queries
1 If the destination database is created by the Flattener, reconnect to the server in order for SAEM to see this new database.
2 In SAEM, select the flattened database.
3 Clear Query > New.
4 Paste the code above into the Query text field.
5 Clear Query > Execute.
This graphic is described in the surrounding text.
See also
Flattener (Normalized Table Builder)