143
Views
6
Comments
Database extension: new table
Application Type
Reactive

Hi!

What's the best practice to add a new table of data to an existing external database? extension?

Thanks...

2021-10-09 07-57-44
Stefan Weber
 
MVP

Yes and no. I believe you already found out, that you cannot add a foreign key in an entity pointing to an identifier of an external database entity. Thus you cannot use any foreign key constraints (DELETE or PROTECT). An Extension is however possible by simply copying the unique identifier, but with the risk of loosing referential integrity when the parent record gets deleted from the external database. JOINs between the external entity and your internal entity are not possible either, so would either have to combine that "by hand" in a server action or you apply a sync pattern from your external database to a internal entity.

2023-11-10 11-46-42
Diogo Barbosa

Hi Stefan

I'm already working on an external database! But I created a new table in SQL Server, and now how do I refresh my entities (external) on service studio? I tried to refresh the dependencies, and I opened the extension in integration studio, but I can't find the way to import the new table to the module... :/

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Diogo,

You indeed need to open the Extension that exposes the tables from the external database, and add the new table. You say you "can't find a way to import the new table", did you import the other tables or was this done by someone else? Have you checked the documentation on how to do this?

2023-11-10 11-46-42
Diogo Barbosa

Hi Kilian,

I already solved the problem :)

We need to recreate the extension and publish it again to apply the new changes.

Thanks!

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I don't think, in general, you should need to recreate it, but I may be wrong. Good that you solved it.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Diogo,

Since it's an external database, this is outside the scope of OutSystems. It very much depends on the database, and what access rights you have to it. You should talk to whoever maintains the database what is the best way to have a table added.

Also, make sure that after the table has been added, you add it via Integration Studio so you can access it in OutSystems.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.