Temporary Entity

Is there a concept of temporary entity in Outsystems like GTT in Oracle?

regards

Hello Random,

In the OutSystems specification no, there isn't (AFAIK)

But during a query to the database, while I would try to avoid, if you need, you can create "temporary" tables, like for example, using the WITH clause, that can be used in the subsequent queries.

Be aware that the use of a WITH (for example) will prevent you from using the Count property of the SQL Tool.

Cheers.

What is your use case? What are you trying to achieve?

I would say (not tested) that you can use an Advanced query with your logic to declare, create and manipulate the GTTs (as soon as your Runtime DB User has privileges to do so). But I wouldn`t recommend it. The maintenance of your project would be an issue.

That`s why if we have a good idea of what you`re trying to achieve, we can help you better.

Hi Random,


No, there is not but you could use an advanced SQL query and create a SQL temporary table there.

You won't be taking the advantage of OutSystems functionalities, as you are actually using SQL capabilities, but in some cases it might be very useful.


Cheers,

João

No. You can create a temporary data on that table and have timer to clear the data. Harder option is use advanced queries to create the table, write and read data, when the process is over drop the table.

The use case is like this:

# a verificator needs to input some answers from customer, say it by phone. (Detail table)

# then based on the customer's answer, she gives an approval by submitting another button. (Master table)

The issue is that:

# when she submits the answers (detail) and record in a table, there is a case where she clicks a menu such than the master record is not saved such that the details become orphan. It is not desired. 

# if i use list to keep the details, i think it will harder to program and maintain as the details can be manipulated before the master is created. And i believe that using entity is much easier.

#So what is supposedly to be required is an entity that is temporary that clear its records whenever a user exits from a screen.

# or is there another beautiful way for this real world case?

# there is also a picture (blob)  in one of the fields of  the detail to save in.

Thank you Sirs,

Best regards


Solution

Hello Random.

I would use a Master record with a status saying if it is workable or not like, DRAFT for not workable yet and REQUESTED for workable, so I could filter it, and then I would have the ID and could add or remove the items to it would the fear of them becoming orphans (or having to do everything again).

In the end, a timer could check DRAFT records with more than a threshold time (like 3 days, for example), and erase them from the system for not being finished, or something like that.

Other solution would be to have a temporary table to the "master" and when the process was finished, migrating the data to the working one, and use a timer to erase old data the same way as before.

There are plenty of other solutions (maybe much better), I'm pretty sure.

Cheers.

Solution

Thank you Sir, for the workaround.

To complete the case, the screen is an activity as part of a BPT. Is there an actvity feature to benefit from to that case?

Regards