External database table without identifier

Hi,


I'm trying to integrate external Oracle table in OutSystems to build screens with CRUD operations. But there is no identifier in the table. So when I add that external entity in Web responsive app, I get only Create method for the table.


How can we build list/details screen on external entity without identifier or if we can add our own identifier within OutSystems? How can we go with CRUD operations in this case?


Regards.

Khurram

Hi Khurram,

When you've no identifier (Primary Key) in the external table, you can still add records using an advanced query. Most likely your table has a composite key. In this case you've got to use the key manually in your query. Something like:

 UPDATE <ExternalTable> SET <Field>=<Value> WHERE <KeyPart1>=<something> and <KeyPart2>=<OtherSomething>

The same goes for selecting a specific record,
SELECT ... FROM ... WHERE <KeyPart1>=<something> and <KeyPart2>=<OtherSomething>

Regards,
Lennart

Hi Khurram,

You can set the identifier in the integration studio. In this other post there is a good image on how to do it.

Regards,

Marcelo

Hi Khurram,

First of all, I would assume that your entity will have 2 or 3 columns that will work as the primary key, right?

Using that case as an example, the Create action is available, for updates and deletes you should go for the advanced query option as Lennart mentioned.

Regarding the screens instead of passing just an identifier for the detail screen, you will need to pass the values that will allow you to retrieve a single record.


Hope this help

Thanks for suggestions. For now, I have used Advanced SQL Query.