# Getting error while executing simple SQL select query

**URL:** <https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877>\
**Category:** Activities\
**Tags:** workflow-diff, completed, bug, studio, database, activities\
**Created:** [April 6, 2022, 3:41am UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877 "2022-04-06T03:41:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rupali2.deshmukh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rupali2.deshmukh/32/177294_2.png) [@rupali2.deshmukh](https://forum.uipath.com/u/rupali2.deshmukh)\
**Post date:** [April 6, 2022, 3:41am UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877/1 "2022-04-06T03:41:18Z")

</div>

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.

For E.g. - Select \* From empmaker\_ar\_head Where sys\_ar\_no =‘802004400045’  
The same query working fine in DB, hardly it will result 20-25 records.

The same query when I executed from Oracle SQL developer its working fine.

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. Environment details  

2. Activity packages versions

 ![image](https://global.discourse-cdn.com/uipath/original/4X/4/e/6/4e60092d56c41b147dd08191229a4ef8c0b92b56.png)

1. Full error message -

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

---

<div class="post-metadata">

**Author:** ![rupali2.deshmukh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rupali2.deshmukh/32/177294_2.png) [@rupali2.deshmukh](https://forum.uipath.com/u/rupali2.deshmukh)\
**Post date:** [April 6, 2022, 9:02am UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877/3 "2022-04-06T09:02:27Z")

</div>

@ [Maciej Kuzmicz](https://forum.uipath.com/u/loginerror)- Could you help here to sort out the issue.

---

<div class="post-metadata">

**Author:** ![alexandru](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alexandru/32/52917_2.png) [@alexandru](https://forum.uipath.com/u/alexandru)\
**Post date:** [April 11, 2022, 2:26pm UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877/4 "2022-04-11T14:26:03Z")

</div>

Can you try with the latest Database.Activities v1.6.1 as we have a potential fix for this issue. Please let me know if this works for you.

---

<div class="post-metadata">

**Author:** ![rupali2.deshmukh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rupali2.deshmukh/32/177294_2.png) [@rupali2.deshmukh](https://forum.uipath.com/u/rupali2.deshmukh)\
**Post date:** [April 12, 2022, 6:12pm UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877/5 "2022-04-12T18:12:02Z")

</div>

Yes, issue is resolved.  
Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [April 16, 2022, 12:59pm UTC](https://forum.uipath.com/t/getting-error-while-executing-simple-sql-select-query/412877/7 "2022-04-16T12:59:55Z")

</div>

Closed on April 16, 2022, 12:59pm UTC

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