Getting Error while using Stored Procedure in ExceuteNonQuery

Hi, I am trying to access a Stored Procedure to update a data table. I have passed the stored procedure name and the table name as input parameters. However when we execute I get the following error : Run command: The type of column ‘Assets Held Currency Code’ is not supported. The type is ‘Object’. The Column ‘Assets Held Currency Code’ is the first column in the table and it is defined as string in UIPath and VarChar in Stored Procedure.

Please help.

seems like there is a type mismatch in the column names defined in the stored procedure and in uipath studio

Thanks @Lak_Ui for your help.

I am basically getting the data from an excel into datatable and am passing this table directly as parameter to the ExecuteNonQuery. As it is a datatable created from READ Range activity(without preserve format), so all the columns will automatically be String in UIPATH.

What I am not sure is that in this case does the datatable defined in the StoredProcedure also need to have all the columns as String(VarChar).

Hi @nanmishra,

Execute Query (calling stored procedure) can needs some backend casting. As you noted UiPath takes in parameters as string while your stored procedure requires a cast to VarChar.

Try to use the string and cast it to varchar. A similar question where an int type is used:

Hope this helps!

Thanks @jeevith for your help.

As am new to the database part, just wanted to clarify:

  1. My datatable that I pass from UIPATH as parameters(in_dttabledata) will have all columns as string. The parameter(@CurrencyExposure) in the Stored Procedure should also be defined as a datatable with columns of type varchar first. Then in SQL the coding should be to loop at this parameter table and pass to separate variables which would be of datatype similar to the TABLE that will be updated with the record)


Solved. Just for information so that it can help others : when using Read Range to read all data from excel the data table columns were of type Object. Had to loop at the table and convert all data type to String to solve the issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.