How to execute stored procedure in uipath?

how to execute stored procedure in uipath?

@rpadev

Use Execute Query Activity,
Mention the Stored Procedure name

Regards,
Mahesh

Use Execute query activity under Database. If it is not available install the UiPath.Database.Acitivities package.Use configure connection and connect to DB.

In properties
Fill the SP name against SQL.
In Parameter pass input values with direction IN.
Choose command type as Store procedure
You can Store the return output in a DT variable if needed.

8 Likes

hey @Rajasegar94 thank you so much for well explanation

While we try to execute stored procedure we need to make sure about the name of the DataBase as well, in case if we are passing DB name in Connection string then we can directly execute [dbo].[storedprocedurename] else [DBName].[dbo].[storedprocedurename] will save us from exception … :slight_smile: Enjoy…

1 Like

Can you share a sample

Pardon me. What you mean by sample.

can you share a workflow to execute stored procedure in uipath

Maria,

Which DB you want connect SQL server or Oracle or MySQL?

SQL server

It is fairly simple then. Can you give more detail on the exact issue you are facing?

Hi Rajasegar

I am connecting to Oracle DB. Can you please help on this

Thanks
Kamesh

can I use execute non query activty? im trying to run stored proc that will do insert to sql server DB

Hello @ANjWolf,

Welcome to the UiPath Community!

Yes, you can use the Execute non Query activity, here’s a documentation and reference.

Happy Automation!

Regards,
PD

4 Likes

Hi Export,
I have below Stored Procedure which I am not able to call in UI path. Can you please guide me on this.
Ex:
Call “DB_COM”.“Package.2USER::SP_SYS_QRY”();
Thanks in advance.

I am struggling to get this to work properly. I can hard code a query into the Execute Query activity and that works, so I know am I connected to my database. With my stored procedure, I am just trying to query data, not make any updates. I have tried the following, and continue to get an “Execute Query: Error ORA-00900: Invalid SQL Statement”

“SPNAME”
“DBNAME.dbo.SPNAME”
“dbo.SPNAME”

When I connect to SQL Server, I can use “DBNAME.dbo.SPNAME” but when I try to connect to Oracle, it fails. Is there another way to write the Oracle SP so that it executes?

@Rajasegar94 @MariaJosephina Do either of you have any suggestions on how to make this work properly with an Oracle connection? I have tested my connection and that works, but I can’t get the SP to execute.

hi,
is your issue resolved?
i am struggling with same problem.
any help with this will be much appreciated.

thanks in advance!

I have not resolved this issue yet. Any advice on this topic would be appreciated.

Thx for this explanation. This solved my problem :wink: