AS400 Statement Invalid

Hi There,
I am running an app with an AS400 for the database. in the development
environment I am getting the following error: 37000 (-104) [IBM][iSeries
Access ODBC Driver][DB2 UDB]SQL0104 - Token ` was not valid. Valid
tokens: ( TABLE LATERAL .

/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-odbc-adapter-2.0/lib/active_record/connection_adapters/odbc_adapter.rb:1519:in
rescue in select' /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-odbc-adapter-2.0/lib/active_record/connection_adapters/odbc_adapter.rb:1514:inselect’
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-odbc-adapter-2.0/lib/active_record/connection_adapters/odbc_adapter.rb:770:in
select_all' /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.10/lib/active_record/base.rb:665:infind_by_sql’
/var/www/onlineordering.coastalpet.com/app/models/item.rb:183:in
filter_categories' /var/www/onlineordering.coastalpet.com/app/controllers/products_controller.rb:6:inindex’

here is the revelvant code for that above two pages:

/var/www/onlineordering.coastalpet.com/app/models/item.rb:183:in
`filter_categories’ =

s = Item.find_by_sql [sql, upc_rule, query_account_number, upc_rule,
query_account_number, upc_rule, query_account_number, upc_rule,
query_account_number, upc_rule, query_account_number, upc_rule,
query_account_number, upc_rule, query_account_number]

/var/www/onlineordering.coastalpet.com/app/controllers/products_controller.rb:6:in
`index’ = @categories = Item.filter_categories(session[:upc_rule],
session[:query_account_number])

I am looking for thoughts on the error Token ` was not valid. Valid
tokens: ( TABLE LATERAL . as I am not familiar with this
error.

On Tuesday, April 29, 2014 4:27:22 PM UTC-4, Ruby-Forum.com User wrote:

/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-odbc-adapter-2.0/lib/active_record/connection_adapters/odbc_adapter.rb:1514:in

/var/www/
query_account_number, upc_rule, query_account_number, upc_rule,
error.


Posted via http://www.ruby-forum.com/.

Wow! never thought i’d see an as400 question in this forum. for the
record, the as400 is the model name of the server, the database you are
using is DB2. the message you are getting basically means you are
passing
an invalid table name. If I remember correctly (and it’s been a long
time), it’s in the format of DDDDD.TTTTT where DDDDD is the database
name
and TTTTT is the table name. The problem is I have no idea where the
error
is popping up. It could be in the database adapter (the gem you are
using
to communicate with the database) or it could be in IBM’s ODBC.

I’ve never used Rails with IBM’s technology. I think the best place to
look for resources on this is the rubyforge project at the following:

https://rubyforge.org/projects/rubyibm/