Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Carlos Henriques
2
Views
9
Comments
espace entitity prefix
Question
Hi.
How can I force my espace to always use the same entity (database table) prefix.
I have an espace that always used the same prefix, something like:
OSUSR_8CU_<entity_name>
An now it started using a new prefix:
OSUSR_GT6_<entity_name>
How can I prevent the Outsystems Platform to continue generating tables with different prefix for the same espace?
Shouldn't the espace always use the same prefix or is there anything that could push the espace to use a new one?
Thanks :)
Kilian Hekhuis
Â
MVP
Are you sure you haven't cloned the eSpace? I've never seen this behaviour, and we have eSpaces dating from 4.2...
Carlos Henriques
I've renamed the espace, and it seems that when the espace is renamed is starts using a new prefix.
Now, every time I create a new entity it creates a table in the database with the new prefix.
The worst thing is that if I publish this espace on a new environment it creates all the tables with the new prefix :\
So, now I need to recompile all the views, stored procedures and reports I had on the other environment.
In my opinion the platform should use always the same prefix for its entities, if I rename the espace or not. This would guarantee a database naming logic.
2 replies
Last reply 12 Mar 2014
Show thread
Hide thread
Curt Raddatz
Carlos Henriques
wrote:
In my opinion the platform should use always the same prefix for its entities, if I rename the espace or not. This would guarantee a database naming logic.
Yes, but would cause huge problems if another eSpace happens to use the same entity name. If you have to have this functionality, there is a way to do it unless you are using the Personal Environment. It's all documented in this post -
https://www.outsystems.com/forums/discussion/3444/configuring-the-physical-table-name-format-for-entities/
- be very mindful of all the comments in that thread that suggest extreme caution before chosing to do this. The concerns were enough to make me change my mind about doing it.
Hope this helps.
Carlos Henriques
Curt Raddatz
wrote:
Carlos Henriques
wrote:
In my opinion the platform should use always the same prefix for its entities, if I rename the espace or not. This would guarantee a database naming logic.
Yes, but would cause huge problems if another eSpace happens to use the same entity name. If you have to have this functionality, there is a way to do it unless you are using the Personal Environment. It's all documented in this post -
https://www.outsystems.com/forums/discussion/3444/configuring-the-physical-table-name-format-for-entities/
- be very mindful of all the comments in that thread that suggest extreme caution before chosing to do this. The concerns were enough to make me change my mind about doing it.
Hope this helps.
What I was saying is that the platform should always use the same prefix for the each espace (not for all espaces) and not change it if I rename the espace.
If I rename an espace its just the same application with a differente name, and it should'nt start using a different prefix for the tables just because of that. It should be consistent and keep using the same prefix for the new tables, and if I publish the application on a new environment each table should have exactly the same physical name on both environments.
Kilian Hekhuis
Â
MVP
Well, the platform doesn't really support accessing the tables outside the platform. That's why I'd love to have native views.
Curt Raddatz
I suspect this would pose challenges to implement which is probably why it doesn't work that way. If you really need this, set the ENTITYNAME setting described in that thread and you should be able to get what you want as long as you make sure all entities are unique. The way I've done this in the past is to make one eSpace that has all the entities and reference it in all other eSpaces. This guarantees the uniqueness of the entity names.
Another way to do this, again assuming you are not using the Personal Environment, is to create all the tables natively in whatever database you are using and then create a database connection that the eSpace uses. This would probably eliminate all the issues you are having.
Justin James
Â
MVP
When I read something like this, my immediate response is, "you may be doing something that is not a good idea". If you are writing something to directly access those tables... don't do it. If you absolutely *must* access them directly, then you need to make a script which creates views to the real tables, using the metadata in ossys_entities and the related tables, and run this script on a "When Published" timer. This is really the only really good way to access your tables through SQL and have reliable, consistent table/column names, and even then you need to account for columns being added/dropped in OutSystems, but remaining in the database.
J.Ja
Carlos Henriques
That script idea is a good one, never tought about that.
It solves the problems with the views and stored procedures, but still have the problems with reports.
Justin James
Â
MVP
Carlos -
Report against the views. Other than it being time-intensive to develop and test this (there is an item in the Forge you can use as an example, by the way, search for "views" I think should do it), there are no downsides to this issue.
One of these days I will just make a component to make this drag/drop easy to put into an app...
J.Ja
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
 Loading...