On Jun 24, 6:23 am, Crupuk <[email protected]> wrote:
> Hello,
>
> This is my first message, i write you because i can't find any good
> method to write clob.
>
> For now i'm using this :
>
> class Mail < Sequel.Model(:mail)
>   def before_create
>     self.id = newnum('MAIL')
>   end
>
>   def around_save
>     cnt = self.headers
>     body = self.body
>     self.headers = "#"                   # Default text to prevent
> "null clob"
>     super
>     content = MailContent[self.id]
>     content.lock!
>     content.headers.write(cnt)
>     content.headers.size = cnt.bytesize
>     content.body.write(body)
>     content.body.size = body.bytesize
>   end
> end
>
> It works as long as the text is not longer than 4k :
>
>           stmt.c:306:in oci8lib_191.so: OCIError: ORA-01704:  string
> literal too long  (Sequel::DatabaseError)
>
> What i'm doing wrong ?

For clob fields you'll probably want to use prepared statements, which
for Oracle only have native support in the jdbc adapter (i.e. JRuby).
The oracle (oci8) adapter doesn't have native support for prepared
statements, so if you want to use that, you would want to add such
support.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to