Specified cast is not valid

Hi Team,

I am getting the error message as ‘Specified cast is not valid’ while execute the Query in Uipath . since there are two multiplication operation in the query and the values are also in decimal numbers.

Please help me getting this resolved.

Regards
Suresh Ghadai

can you share some screenshots from what you have done / the validation message. Thanks

Hello @Suresh_Ghadai

Are you trying to do the database automation or doing some quering in the datatable. It would be better if you can give more insights to your requirement.

I am just trying to execute one Query and getting the value into DataTable. however Query is not executing . Database connection is correct since i am able to run other queries.

image

Regards
Suresh Ghadai

would recommend to focus that the used variable datatype are in accordance to the SQL Datatypes

Hi Peter,

Please find the below screen post running the Query.

image

Regards
Suresh

Hi Peter,

Actually we don’t need to create any variable in Uipath because data is getting from the table of the Oracle DB. Just to execute the query and save in a DataTable.

Please let me know one example how to conver the value into decimal in sql query.

Hello @Suresh_Ghadai

I hope you are using execute query and getting the value as a datatable. Could you please confirm in which actvity you are getting the error.

It would be better if you can share the screenshot of the workflow which you have created.

a more efficient is sharing the details with us. e.g. SQL statement

we reacted on this statement

also feel free to do some RnD against the DUAL for prototypings

Hi Rahul,

I have used only one two activities ,
1st Activity - Connect - Its working
2nd Activity- Execute Query- Getting error here(Not working)

I have already shared the screen shot of error message

Regards
Suresh Ghadai

I had this issue recently and it was to do with the actual data. One of the columns had decimal numbers but the number of digits after decimal exceeded what was expected by UiPath so it stopped after 51 rows. In my case I got the first 51 rows, so when I ran the same script on SQL developer it was easy to spot the reason. I solved this by rounding to 4 digits after decimal in the script. Hope this helps someone.