Re: [gnome-db] Reading LOBs with the Oracle backend

2005/8/23, Magnus Bergman <magnus bergman observer net>:
> Currently there is no completely functional support for reading LOBs in
> the Oracle backend in libgda (no other data database abstraction
> library, except Perl, seams to support it either).
> The problem is this: Then reading a row from the Oracle database you
> first have to allocate enough memory for it. This is done by
> requesting the maximum size of each column and allocate this amount of
> memory. So far everything is fine. But then it comes to LOBs this
> doesn't work. What is reported as the maximum size for a LOB column
> then? Some parts of the documentation say -1, others 0, yet others say
> 4. But I get 32767. If a buffer of 32767 bytes is allocated (I guess
> this is what happens in libgda) it works sometimes and crashes
> sometimes (or just doesn't work). The actual maximum size is far beyond
> that of course so it doesn't really make sense to allocate that much
> memory.
> The right way to do this is to not read the contents of the LOB,
> but read the field as a LOB handle instaed. And at a later stage use
> the LOB handle to get the size of the LOB and read it's contents.
> Perhaps I could fix this if somebody tells me in which function(s) this
> should be handled.

I've been working on the GdaBlob class recently and adding blob
support for Oracle is a matter of deriving the GdaBlob class and
implementing its virtual methods for Oracle (as it has been done for
PostgreSQL and Firebird with the GdaPostgresBlob and GdaFirebirdBlob
classes respectively).

Please let me first check back my local modifications in CVS before you do it.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]