【发布时间】:2015-02-16 12:12:21
【问题描述】:
如何使用rails 2从oracle数据库中获取1000多条记录
@business_users_loc = User.find(:all,:conditions=>"(users.role_id NOT IN ('#{Role[:submember].id}') AND locations.mac_id IS NOT NULL and users.mac_id IS NOT NULL and locations.location_type='Business')",:order => 'users.created_at DESC',:joins=>:locations,:include=>[{:locations=>[:social_network_mac_id,{:pronto_gateway=>[:heartbeat]},:fb_sponsors_fanpage]}],:select=>"distinct(users.login_slug), users.created_at, users.email, users.login, users.id")
当我尝试上述查询时,我得到了这个错误
ActiveRecord::StatementInvalid: OCIError: ORA-01795: maximum number of expressions in a list is 1000: SELECT * FROM "LOCATIONS" WHERE ("LOCATIONS"."ID" IN (19228,18667,14642,15727,13541,14700,....
你能帮帮我吗....
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-2 ruby-1.8.7