Forum: Ruby on Rails sql server freetds/odbc question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jamie O. (Guest)
on 2006-01-10 06:09
(Received via mailing list)
I'm having an error from Linux via freeTDS/ODBC to SQL Server with
cod that runs fine against SQLite and MySQL. Here's the code:

def find_recipes_for_workorder_by_id
     @recipe_pages, @recipes = paginate_with_sort :recipes, :per_page
=> 10, \
                    :conditions => ["recipe.workorder_id = ?", params
     render :template => 'recipe/list'

(I've included the custom sorting code at bottom of message.)

Here's the top of the error:

DBI::DatabaseError ( (8156) [unixODBC][FreeTDS][SQL Server]The column
'name' was specified multiple times for 'tally'.):
     /usr/lib/site_ruby/1.8/DBD/ODBC/ODBC.rb:168:in `execute'
     /usr/lib/site_ruby/1.8/dbi/dbi.rb:640:in `execute'
     /usr/lib/site_ruby/1.8/dbi/dbi.rb:671:in `select_all'
sqlserver_adapter.rb:354:in `add_limit_offset!'

Any help appreciated!


class ActionController::Base
   def paginate_with_sort(collection_id, options={})
     @params[:sort_direction] ||= '-1'
     asc_desc = {'1' => "asc", '-1' => "desc"}
     options[:order] = "#{@params[:sort_by]} #{asc_desc[@params
[:sort_direction]]}" if @params[:sort_by]
     @params[:sort_direction] = @params[:sort_direction].to_i * (-1)
     paginate collection_id, options
Jamie O. (Guest)
on 2006-01-10 06:18
(Received via mailing list)
Don't bother! That code works! I had run "rake deploy" which appeared
to succeed, but actually hadn't.

This topic is locked and can not be replied to.