32
Views
3
Comments
Solved
Execute a Stored Procedure
Question

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:

  1. Stored procedures cannot be executed on the OutSystems Cloud Database.

  2. Stored procedures are only possible in an on-premises environment.

  3. It may be possible by using this Forge component: https://www.outsystems.com/forge/component-overview/974/how-to-execute-stored-procedures-o11

  4. 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.

2025-12-22 13-50-43
Sherif El-Habibi
Champion
Solution

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.

2025-12-22 13-50-43
Sherif El-Habibi
Champion

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:

  1. Use Integration Studio to build an extension.
  2. Connect to the local database using your C# .NET code.
  3. Create the function inside the code that executes the procedure then publish and expose the extension so it can be used in OutSystems.

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:

2025-11-06 09-06-15
Yongsu Lee

Hello @Sherif El-Habibi ,

Thank you for your thoughtful and detailed response.

Just to confirm my understanding:

  1. It is possible to execute stored procedures on an external database connected through Integration Builder.

  2. 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.

2025-12-22 13-50-43
Sherif El-Habibi
Champion
Solution

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.

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