Hello Community,
I would like to execute a CREATE stored procedure (and generally run stored procedures) in a database from my OutSystems application.
After searching the forum, I found the following information:
Stored procedures cannot be executed on the OutSystems Cloud Database.
Stored procedures are only possible in an on-premises environment.
It may be possible by using this Forge component: https://www.outsystems.com/forge/component-overview/974/how-to-execute-stored-procedures-o11
Some posts mention it might be possible by calling it through the RuntimePublic.Db API.
What I want to try is: from an OutSystems Cloud environment O11 app, execute a stored procedure on an external database installed on my local PC (on-premises / external DB) or
from an OutSystems Cloud environment O11 app, execute a stored procedure on an Cloud Outsystems Database. (Although I saw information saying it’s not possible, I’m wondering if the situation has changed.)
Is this possible? If yes, what is the recommended approach?
Thank you.
Based on my understanding: Yes, it is possible to execute stored procedures on an external connected database. However, for the built-in database (by built-in I mean the internal database used by OutSystems, which stores things like the eSpace/module data), it is not possible to execute stored procedures.
Hello @Yongsu Lee,
Based on what I know, if you want to connect to an external database, you normally have to follow the standard procedure by going to Integration Builder and connecting to the database server. However, if the database is on my local PC, for OutSystems Cloud it is still considered an external database, so the same normal procedure must be followed.
There is way I have seen, although I honestly have not tried it personally yet.
You can use Visual Studio to connect to your local database, which is straightforward. After that, you can execute the stored procedure inside a function, and this function can then be exposed as an extension so that your OutSystems application can execute it. It may not be the most direct approach, but it can still do the trick.
The flow would be something like this:
Then, in Service Studio, manage dependencies to reference and use the relevant action.
There is also a LinkedIn post by @Shriram Bisen that explains how to do this using a similar approach. You may want to check it out:
Hello @Sherif El-Habibi ,
Thank you for your thoughtful and detailed response.
Just to confirm my understanding:
It is possible to execute stored procedures on an external database connected through Integration Builder.
It is not possible to execute stored procedures on the built-in OutSystems Cloud Database.
Is my understanding correct?
Thank you again for your help.