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

DB2 ActiveRecord::JDBCError: [SQL5016] #598

Closed
queuebit opened this issue Nov 5, 2014 · 5 comments
Closed

DB2 ActiveRecord::JDBCError: [SQL5016] #598

queuebit opened this issue Nov 5, 2014 · 5 comments
Labels

Comments

@queuebit
Copy link

queuebit commented Nov 5, 2014

I receive this error from rails 3.2, jruby-1.7.16 when I try to perform a .save on a new ActiveRecord::Base model.

ActiveRecord::JDBCError: [SQL5016] Qualified object name SQLPRIMARYKEYS not valid.: SELECT 1 FROM SYSIBM.SQLPRIMARYKEYS WHERE TABLE_NAME = 'MONTHLY_FINANCIAL_INFORMATION'

This query seems to come from lib / arjdbc / db2 / as400.rb.

When I look at the error code in DB2 documentation, it makes it sound like an error with naming. It recommends changing the jdbc driver connection to use system naming, but that causes a different set of errors.

Any ideas? Things I should try? Thanks!

I have been able to get around this error in the past by making a raw SQL insert query against DB2 directly for the initial save action (new record).

@kares
Copy link
Member

kares commented Nov 6, 2014

not really since we do not have anything to test this against, we rely on "outside" commiters ... we're also planning to deprecate the AS400 parts in favor of https://github.com/pierrickrouxel/activerecord-jdbcas400-adapter since we're pretty much playing a dump merger here, maybe ask around @pierrickrouxel

@kares kares added the db2 label Nov 6, 2014
@pierrickrouxel
Copy link
Contributor

As said @kares you can try with the new adapter. If the bug is always present please create a new issue in my repository.

@queuebit queuebit closed this as completed Nov 6, 2014
@queuebit
Copy link
Author

queuebit commented Nov 6, 2014

I wasn't able to get activerecord-jdbcas400-adapter working with our database. I was getting [SQL0804] SQLDA or descriptor area not valid. error. I will just use the SQL insert query for the time being.

Thanks.

@pierrickrouxel
Copy link
Contributor

What is your IBM i version ?

@queuebit
Copy link
Author

queuebit commented Nov 6, 2014

What is your IBM i version ?

6.1

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

No branches or pull requests

3 participants