Ruby on Rails Tuesday, April 29, 2014



On Tuesday, April 29, 2014 4:27:22 PM UTC-4, Ruby-Forum.com User wrote:
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 <IDENTIFIER>.

/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: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:770:in
`select_all'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.10/lib/active_record/base.rb:665:in
`find_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:in
`index'

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 <IDENTIFIER>. as I am not familiar with this
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/
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/11f886db-f734-403d-965e-647cbae42827%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment