Getting 'Invalid SQL Query' error while executing procedure

What is the syntax to pass a procedure in ‘Execute Query’ step in UI path.Can someone plese guide because I am getting -

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Data.Odbc.OdbcException: ERROR [42000] [Oracle][ODBC][Ora]ORA-00900: invalid SQL statement

For sample check the below thread -

I did check this post and configured eveything like it.The place where it is giving SPNAME.I have given my Procedure name in double quotes but Getting the error I mentioned.

Can you check your connection string and also if stored procedure exists in the data base?

I checked my connection string it is fine since I am able to get the result of normal sql queries…and stored procedure also I can execute directly from db…and it is executing…

Is stored procedure returning any data ? If not, try with Execute Non-Query activity.

no it is not returning any data but i have alraedy tried with Execute Non-Query and Execute Query both none is working and same error.

It Is Oracle Db.

@Rajasegar94 @KarthikByggari any suggestion what should I try…??

Can you please check whether the procedural option is enabled or not by following the below articles. Give a try -

Regards,
Karthik Byggari

Try to pass command to execute the SP instead of SPName.

SQLEXEC (SPNAME sp_name,
[ID logical_name,]
{PARAMS param_spec | NOPARAMS})

Make sure to change CommandType as Text.

Thanks @KarthikByggari @Rajasegar94 let me try and get back to you guys.

Got it done?

yes…but in a different way.Below are the things i did-

1.After the start step of flow chart I have included an Invoke Code Activity
2. When you click on edit code of Invoke Activity.You need to write below code-

Dim Oraclecon As New System.Data.OleDb.OleDbConnection(“Provider=MSDAORA;Data Source=your datasource name;User ID=your Id;Password=your pwd”)

Dim SqlString As String =“Some Input String”

Oraclecon.Open()

Using cmd As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand(“Procedure Name”,Oraclecon)

Try
cmd.CommandType = CommandType.StoredProcedure

Dim parameter As System.Data.OleDb.OleDbParameter

parameter = cmd.Parameters.Add(“@query_string”, System.Data.OleDb.OleDbType.LongVarChar)
parameter.Value = SqlString

parameter = cmd.Parameters.Add(“outparm”, System.Data.OleDb.OleDbType.VarChar,100)
parameter.Direction = ParameterDirection.Output

cmd.ExecuteNonQuery()

Catch ex As Exception
console.WriteLine(ex.Message)
Finally

End Try

End Using

3.Thats it.run your flowchart it will execute.

And also please note:
If it gives some OLE DB error try to import System.Data.OLEDB to fix the error.
If it doesnt fix your issue then download AccessDatabaseEngine.exe and install it, which contains Microsoft OLE DB Provider for Oracle (MSDAORA) which will definitely fix your issue.
Thanks!

Hi Ruchit_Bhan,

I have similar issue and trying my luck to get my PL/SQL script to work in uipath.
May i know what i need to insert on the SqlString as String= “” or can you provide a sample. by the way my stored proc has no parameters required.

here is stored proc I am testing

CREATE OR REPLACE PROCEDURE greetings
AS
BEGIN
dbms_output.put_line(‘Hello World!’);
END;
/