[ServiceStudio] Display physical database table name for a given entity.
Service Studio
OutSystems 5.0
Sometimes you might want to verify if the correct data has been inserted into a table, or would like to insert records into a table manually. It be good to know the physical name of a given entity.
There's the sqlmap eSpace that you could use, don't know if it is downloadable somewhere. Also, you can use this query:

select * from ossys_Entity where name = @logicaltablename

to find a table's physical name (although of course there may be more than one result, as each eSpace could define the same logical table name).

I think the biggest problem with this request is that Service Studio may not be aware of the physical table names at all, since the compiler produces them.

2016-11-21 23-23-05
Gonçalo Borrêga
This can be achieved by querying the metadata API/entities. Physical_Table_Name attribute on the Entity entity provies you that value.
Goncalo, what's this metadata API you mentioned?
2016-11-21 23-23-05
Gonçalo Borrêga
Go to Add/Remove references and under the (System) producer you can find a lot of the metamodel of the platform.
These entities can be referenced just as any other and queries can be performed on them.

This way you are able to know most of the underlying information for what is produced by the platform.

Thanks, this is quite useful.