While executing the DB query getting error

Hello Community,

I’m getting the below error while executing the DB query, the connection was successful but while executing the query I’m getting the error.

The same query when I executed from Oracle its working fine.
Can anyone please guide me the issues which I’m facing.

Error - A value of type ‘System.DBNull’ cannot be set to the location with name ‘out’ because it is a location of type ‘System.String’.

1 Like

@rupali2.deshmukh ,

You are trying to send a null for a column is not accepting null values in the database. Instead of sending a empty string you need to pass DB null value for that param.

Debug and get the query from UiPath and try to execute that from SQL, then you will get the actual issue.

I have tested its working fine in the SQL. Its a simple query for retrieving the data for e.g. Select * from DB.
Only issue is while executing with UiPath.

Hi @rupali2.deshmukh , Is this a select query? Because the error says that you are trying to set a null value. Are you saying that the select query is failing ? What is the output of the select query? What are the data types?

Hi @rupali2.deshmukh , Can you please restart the UiPath and do the connection again.

Also make sure to use the latest version of UiPath.Database.

I hope this will help, thanks.

Yes, select query is failing. Its simple select query and output will be in terms of data table.

I did the steps but still I’m getting the same issue.
Can you please suggest the way to move forward.

Can you please paste the query here? if possible? @rupali2.deshmukh

Below is the query.

Select * From empmaker_ar_head Where sys_ar_no =‘802004400045’

Hi @rupali2.deshmukh ,

Could you try Selecting the Column Names One By one in the Select Query, The Syntax is as below :

SELECT column1, column2, ...
FROM table_name;

Instead of * try specifying the column names so that we can identify if the error is due to a Particular Column, we can then decide a Work around for this.

I just ran by the way you suggested but still getting the same error.
But from SQL developer its working fine.

Select Client_ID, N_Name From empmaker_ar_head Where sys_ar_no =‘802004400045’

@rupali2.deshmukh , As it is a Simple Query, We would need to Debug further to understand the cause.

Please do Check by selecting only single Column at a Time, also without the Where clause.

Also, If you do have any other Table available, Do Check the Select Query on that and Check if it provides the Same error.

I tried selecting only single Column at a Time, without the Where clause its not working.

Also I tried with another table having the 4 records, still I’m getting the same error.

@rupali2.deshmukh ,In that case, Could You Specify which version of Database Activities are you using ?

Most probably there is a Bug, but Could You also make sure the connection configuration is proper as well.

If possible, Do post Screenshots of your workflow to analyse the flow.

Im using the version of 1.5.0, The connection was successful with database by using connect activity.

Please see the below flow.

image

Can anyone has any idea about how to report this issue to UiPath team?

Hi Did you got solution ? I am also facing same error

@sarathi125, @shreyash_shirbhate, same issue when trying to execute stored procedure with OUT parameter of type VARCHAR and specifying a string variable to that parameter in UiPath. When this parameter is not assigned inside a procedure - it doesn’t return a string to place into variable - it returns NULL.
That NULL can not be correctly converted to String.Empty in UiPath (
Though in any visual clients to Oracle execution of that procedure finishes clearly.

Hello @alexander.orischenko , were you able to resolve the issue?