76
Views
5
Comments
Solved
Query returned no rows - external Oracle Database
Application Type
Reactive
Service Studio Version
11.12.6 (Build 51684)
Platform Version
11.13.1 (Build 31652)

We are trying to get data from a view on an external Oracle Database.

We are using a connector and a connection to the external database to do it

The problem is that when the developer of the view makes a select statement on the view using a tool like SQL Developer, their query returns data.

When we try in OutSystems using both an aggregate and SQL query, we get a "Query Returned No Rows" message

Do you have any idea on what could be wrong?


2018-07-23 11-05-10
Marios Andreas Tofarides
Solution

Hi Nuno, and thanks for the reply,

It was a simple SELECT statement with no conditions. 

We found what it was. When the SELECT statement was executed using the Outsystems user, no rows were fetched. When it was executed with a different user, rows were fetched.

It had to do with the permissions the Outsystems user has on that database.


2018-06-05 16-54-03
Maria da Graça Peixoto

Stupid question - have you verified the username and password to access the data base in the Database Connection ?

2018-07-23 11-05-10
Marios Andreas Tofarides

Thank you! :P

I'd get an "incorrect username/password" error if that was the case.

What I didn't check was whether when running with the specific user, the query returns results.

There was this peculiarity.

 

2016-04-21 18-13-58
Nuno Rolo
 
MVP

Hi Marios,

Did you try to do a simple selection without conditions? Are you using null or '' in the conditions of the query? Please note that in OutSystems when using Oracle an empty string needs to have a space, like this ' ', and also for null it's possible that you have some failures. 

2018-07-23 11-05-10
Marios Andreas Tofarides
Solution

Hi Nuno, and thanks for the reply,

It was a simple SELECT statement with no conditions. 

We found what it was. When the SELECT statement was executed using the Outsystems user, no rows were fetched. When it was executed with a different user, rows were fetched.

It had to do with the permissions the Outsystems user has on that database.


2016-04-21 18-13-58
Nuno Rolo
 
MVP

Glad you found the issue. 

Sometimes these permissions issues are difficult to remember because we are expecting to get an error instead of no rows returned.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.