Skip to content
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

Sql syntax error connection from rails 6.0.3 to informix #114

Closed
bnadav opened this issue Apr 23, 2021 · 3 comments
Closed

Sql syntax error connection from rails 6.0.3 to informix #114

bnadav opened this issue Apr 23, 2021 · 3 comments

Comments

@bnadav
Copy link

bnadav commented Apr 23, 2021

Hi all, I just tried installing ibmdb 5.2.0 and tried run a simple find from consol, but got a sql syntax error. Any ideas ?
It seems to me that this exact syntax is not compatible with informix.
Thanks

irb(main):001:0> MonUser.first
MonUser Load (4.8ms) SELECT mon_users. FROM mon_users ORDER BY mon_users.id ASC FETCH FIRST 1 ROWS ONLY*
Traceback (most recent call last):
1: from (irb):1
RuntimeError (Failed to execute statement due to: [IBM][CLI Driver][IDS/UNIX64] A syntax error has occurred. SQLCODE=-201)
irb(main):002:0>

@akhilravuri1
Copy link
Contributor

Hi @bnadav

This issue does not exist with Luw, zos and Iseries servers.
Can you please give a try with MonUser.first(1)

Thanks,
Akhil

@bnadav
Copy link
Author

bnadav commented Apr 27, 2021

Hi @akhilravuri1
Thanks for your reply.
I used a docker container of informix developer-database.
The host is my windows pc. I used ubuntu in wsl2 as host linux.

MonUser.first(1) resulted in the same error:

nadav@nite-3440:~/rails-projects/myApp$ bundle exec rails c
Loading development environment (Rails 6.0.3)
irb(main):001:0> MonUser.first(1)
MonUser Load (8.2ms) SELECT mon_users.* FROM mon_users ORDER BY mon_users.id ASC FETCH FIRST 1 ROWS ONLY
Traceback (most recent call last):
1: from (irb):1
RuntimeError (Failed to execute statement due to: [IBM][CLI Driver][IDS/UNIX64] A syntax error has occurred. SQLCODE=-201)
irb(main):002:0> exit

@praveen-db2
Copy link
Collaborator

@bnadav This error is thrown from server. Nothing to do with our adapter or cli driver. If you form correct query it should work. Or you can try using informix specific ruby driver/adapter. Closing this issue as we dont support for Informix. User is free to reopen if he finds any issue specific to DB2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants