Skip to content

DB2SQL agent is running with errors: Cannot query the correct data via SQL statement. #6663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
gavinju opened this issue Mar 30, 2025 · 2 comments
Open
4 tasks done
Labels
🐞 bug Something isn't working, pull request that fix bug. 🙋‍♀️ question Further information is requested

Comments

@gavinju
Copy link

gavinju commented Mar 30, 2025

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Describe your problem

Using text to sql、db assistant, there is an error: Cannot query the correct data via SQL statement.

What is the reason for this?

@gavinju gavinju added the 🙋‍♀️ question Further information is requested label Mar 30, 2025
Copy link

dosubot bot commented Mar 30, 2025

@gavinju 🌟 Hey there! I'm here to help you with any bugs, questions, or even becoming a contributor. I'm your friendly neighborhood bot, ready to assist you while we wait for a human maintainer.

The error "Cannot query the correct data via SQL statement" occurs when the DB2SQL agent is unable to successfully execute a SQL query after multiple attempts to regenerate and refactor the SQL statement. This happens when the _run method in the agent/component/exesql.py file tries to execute a SQL statement, and if it fails, it attempts to regenerate the SQL statement using the _regenerate_sql method. If the regenerated SQL statement still fails to execute correctly after a specified number of attempts (self._param.loop), the error message is returned [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the 🐞 bug Something isn't working, pull request that fix bug. label Mar 30, 2025
@KevinHuSh
Copy link
Collaborator

Could you debug ExecSQL alone with a executable statement that has been test through the database client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working, pull request that fix bug. 🙋‍♀️ question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants