33
Views
11
Comments
Entities Name in backend databases

I know that the entities name remain same in the front end in different environments? However, would like to confirm whether do the entities have same name in the different environments in backend databases too? Or the names get changed for each environment?

Also,  if don't have access of the backend databases, how can I know the entities name in the different environments to update/delete any data into/from any particular entity?

Rank: #97

Hi Sachin,


The tables physical table name is not necessarily the same in the different environments. The name of the table in the database assumes the following naming OSUSR_<3 characters representative of the module>_<table name> (e.g. OSUSR_1XO_Customer).

When you move a table to a different module, the table name does not change (so the data is also not moved), just the metadata but when you deploy that table to another environment it will take the 3 characters of the new Espace (e.g. OSUSR_FT2_Cusomter). That's an example of a common situation causing a different name.

Using Outsystems, you don't need to be aware of the physical table name as OutSystems querying data abstracts you from that.

You use the metadata model ({Entity}.[Attribute] is the way to use the table and its fields) to refer to a table instead of the physical table name and the conversion to the physical table name to run in the DB is taken care of by the platform.


Hope it helps.

Cheers,

João

Hi Sachin,


If you want to update/delete any data into/from any particular entity you wont be required physical table name you can simply do it by either entity action or advance sql using entity name.

Physical table can be differ in different environments if you have database access then you can check in ossys_entity table.

One more scenario if you are having more than one environments with different physical_table_Name and you are using store procedure then I can understand you should not change the table name in store procedure for different environments in this case you create synonyms for related tables in all environments to use same store procedure.


Regards

Shashikant Shukla



Rank: #171

Sachin,
Another good source of information explaining the changes in the table names and versioning is this post and this article take a look!


OutSystems change the names of the tables when you delete it in Service Studio for example, so you may have more than one table with same name but with different 3 characters Suffix. It is very well explained in the article above.


About the exact point you want to know the article says this:


"The XYZ code is unique per eSpace. Each eSpace has a preferred XYZ code to use. If I have an eSpace named “CustomerPortal” and and in my Development environment its tables get the XYZ code of “6D5” and then I deploy CustomerPortal to my QA environment, the XYZ code in QA should also be “6D5”. However, this is not a guarantee. One exception is if there is another eSpace using the same XYZ code, in which case a new one will be used. This will often happen if you deploy an eSpace to an environment, delete that eSpace, then deploy it again to the environment. Another exception is that renaming an eSpace will change its preferred XYZ code for new Entities."


Cheers and Regards,

RR :)

Rank: #325

Hi,

You can check the Physical table name via Entity "Entity" on System on Manage Dependency


Hi Sachin,

As a quick solution you can try using the SQL with a simple select statement in your screen action and execute it. This will give you the exact generated SQL statement with actual table name.


Let me know if this helps.