I’m trying to make an INSERT Query within my Oracle database and have redash configured to use cx_Oracle v5.2 as well as set up the necessary library paths and other variables. However, when I run this query, nothing gets inserted into the database and I get the error: Error Running Query : Query completed but it returned no data. My process has been inserted below, would love to know if anyone else has had trouble with this issue and resolved it or if this is a bug I should submit for future fixes with how the redash oracle query runner works. My user for oracle has read and write permission so it isn’t a matter of not being able to insert, but maybe has to do with how the cx_Oracle module is trying to integrate with the redash python script. Thanks for your help!

I have the same problem with mysql update


This is a confirmed bug with mysql data source. What is the best way to file a bug report @arikfr?

I have not reviewed the code, but I would be willing to guess that a con.commit() isn’t happening since if a insert and select is run in the same query, the inserted row is returned, however if run in separate queries, the inserted row no longer appears.

Patch to enable committing

diff mysql.py.8.patched backup/mysql.py.8.backup
<             rowcount=cursor.rowcount
<             elif rowcount==0:
<                 r.json_data = None
<                 r.error = "No data was returned and no rows were updated."
<                 connection.commit()
<                 if rowcount == 1:
<                         r.error = "%s row was updated."%rowcount
<                 else:
<                         r.error = "%s rows were updated."%rowcount
>                 r.error = "No data was returned."

@doddjc I’m guessing you will need to patch the Oracle code similarly (if you haven’t already).

1 Like