Forum: Ruby Re: Populating 'long' data column with Ruby OCI8 (trying aga

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gennady B. (Guest)
on 2006-01-18 22:37
(Received via mailing list)
Hi, KUBO

Thank you very much for the reply. I got the following error after I
applied the patch:
/usr/local/ruby-1.8/lib/ruby/site_ruby/1.8/oci8.rb:656:in `bindByName':
Not supported type (8)

I changed bind_param to
c.bind_param(':data', data, OCI8::SQLT_LNG)

If I do not change it, I end up with truncated data.

As for changing "datasize = 65535", I did "datasize = 500000". However,
when querying the database populated by other means with 200k long
columns, I always get back a string of size 65535. This limitation must
be in place somewhere else (inside OCI?).

Thanks again for trying to help. I ended up using OTL (C++) for
populating and updating long columns, as pure OCI interface simply
overwelms me. It would be great, though, to have support for this in
Ruby OCI8 later sometime.

Sincerely,
Gennady B..
KUBO Takehiro (Guest)
on 2006-01-19 05:22
(Received via mailing list)
Hi,

"Gennady B." <removed_email_address@domain.invalid> writes:

> Hi, KUBO
>
> Thank you very much for the reply. I got the following error after I
> applied the patch:
> /usr/local/ruby-1.8/lib/ruby/site_ruby/1.8/oci8.rb:656:in `bindByName':
> Not supported type (8)

Sorry, I haven't tested it. oci8.so doesn't support OCI8::SQLT_LNG(8).

> I changed bind_param to
> c.bind_param(':data', data, OCI8::SQLT_LNG)
>
> If I do not change it, I end up with truncated data.
>
> As for changing "datasize = 65535", I did "datasize = 500000". However,
> when querying the database populated by other means with 200k long
> columns, I always get back a string of size 65535. This limitation must
> be in place somewhere else (inside OCI?).

Probably inside OCI. The 9th argument of OCIDefineByPos() is 'ub2
*rlen'.
ub2 means unsigned two-byte integer, whose max value is 65535.
It needs piecewise fetch to fetch long column over 65535.
This topic is locked and can not be replied to.