it works like that and returns 2 dates; but in my uipath process i could not get the result.
In my process, i have an activity connect and execute query. Firstly, i tried to execute todays date procedure, but it does not work. Do you have any idea that can help me to solve this problem?
You have to give the parameter name in Name column
the direction of the parameter is a type of I/O
Type of the parameter in the Type column
passing a value to the parameter
if you want to get values form the stored-procedure via output-parameters, you need to use ExecuteNonQuery instead of ExecuteQuery.
ExecuteQuery only returns a Datatable → result from the procedure
ExecuteNonQuery returns how many rows are affected in the output-datatable and the output-parameters.
You also need to change the Direction of the output-parameter to “Out” in UiPath
A you can see, you do not return the @return_value via parameter but via the select-statement.
In my opinion that’s really ugly - why not use an output-parameter?
If you really want to use the SQL-statement like that you need to use ExecuteQuery and remove the Return-value-parameter in the parameter-list of UiPath. You will get your return_value via Output->Datatable in ExecuteQuery
If this query need to execute using ExecuteQuery activity, then in properties command type is text format yes… then how can i write that query in a text format
ahhh, I can see it now.
Your return_value will be an actual return-value in the procedure - I thought you will return the value via select.
I don’t know if this code is up to date, but it seems like the ExecuteNonQuery does implement a return-value (ExecuteNonQuery_GitHub). Maybe the datatable returns your return-value in the affectedRecords-output when using executenonquery…
Have you tried that one?
I’ve never worked with the return-values myself but I guess (i do not know!) it is not implemented in the database-activities if this one above does not work.
Then you have multiple options
change the current procedure to get the value via output-parameter
create a procedure to call your procedure which returns the return-value via output-parameter (it’s ugly but it would do what you need)
create your own database-activities and implement the return-value