我使用Oracle数据库存储有关课程的信息。
我有Course模型
class Course < Sequel::Model
set_dataset Sequel.lit(TABLE_NAME_HERE)
set_primary_key :offer_rk
end每门课程都有一个可以超过4000条长度的描述。
因此,我被迫将description列的类型设置为Clob。
在我的代码中,我有一个类似的
course.update description: large_text_here不幸的是,它会引发一个错误。
OCIError: ORA-01704: string literal too long似乎续集将描述保存为普通的String,而不是Clob值。
如何正确保存Clob字段中的大文本?
我应该用某种方式修补这个方法吗?
module Sequel
module JDBC
module Oracle
module DatabaseMethods
def schema_column_type(db_type)
end
end
end
end
end谢谢。
发布于 2016-07-12 15:25:16
尝试使用prepared_statements插件:Course.plugin :prepared_statements
https://stackoverflow.com/questions/38325948
复制相似问题