rsim/oracle-enhanced — Issue #112: Oracle doesn't support DISTINCT with CLOB columns during joins
Author: sixty4bit
Created: 2011-10-28 22:53:42+00:00
State: open

We have a table that has a CLOB in it. Whenever we try to get a unique list from that table from a join the call blows up:

Calling @order.deliveries throws an "OCIError: ORA-00932: inconsistent datatypes: expected - got CLOB" error (specifically ActiveRecord::StatementInvalid). Below are the classes.

```
class Order < ActiveRecord::Base
has_many :items
has_many :deliveries, :through => :items, :uniq => true
end

class Item < ActiveRecord::Base
belongs_to :order
belongs_to :delivery
end

class Delivery < ActiveRecord::Base
# this is the table with the CLOB
has_many :items
has_many :orders, :through => :items
end
```