Execute SQL Script in Mobile App

Execute SQL Script in Mobile App

  

I need to execute a SQL Script in my mobile app when the user enters data on a screen.  I have not been able to find where and how I can do this.  The SQL Script will read data from a table, do calculations and update another table.  I know how to write the SQL, just not sure where in Outsystems I can execute it.  Thank you for your help!

I guess you are trying to find the advanced SQL in your toolbox within a client action?

Advanced SQL or a server aggregate are not client side, but server side.
You will have to create a server action and use SQL there. Afterwards call the server action in your desired client action. (even though it's not recommended and will create a warning)

Second question : Is a 'server' aggregate not more than enough?

Just create a button and then in the button client action you can do your logic. If the data you want to update is in local storage, just put the local entity action in the logic flow.

If the data is in database server, you must create a server action wrapper to call the remote entity action and indeed you must do mapping data from the mobile to the server.

ofast budiantho wrote:

Just create a button and then in the button client action you can do your logic. If the data you want to update is in local storage, just put the local entity action in the logic flow.

If the data is in database server, you must create a server action wrapper to call the remote entity action and indeed you must do mapping data from the mobile to the server.

Do you have an example?  I found the SQL tool in the Server Actions but it is not clear how to do an UPDATE.  Not sure how the Output Entities/Structures works with a SQL Update. 

Thank you for the responses!


Solution

here the sample...

may this helps,

tan

Solution

Yes thank you tiong!