Re: storing graphics in oracle
Date: 1996/10/25
Message-ID: <54qee7$suo_at_news.ingr.com>#1/1
johne_at_parallax.co.uk (John Eccleston) writes: > In article <326D05BB.1D85_at_intelsat.int>, Rohit Saran <rohit.saran_at_intelsat.int> wrote:
> >If one stores a bit-mapped graphics in Oracle, how does one retrieve
> >it.. Can it be done using SQL or some other techniques have to be used.
> >Any pointers will be appreciated.
> >
> >Thanks/Rohit...
>
> Hi,
>
> Be aware that PL/SQL allows a maximum 32K to be read for a LONG column.
> It gives errors when attempting to read LONG columns containing more data
> than this.
>
> Pro*C can be used to insert and select from LONG columns however I think
> it must be done as one block. It would be really nice if you could read
> the LONG column in chunks (like reading a file).
>
> Regards
>
Using OCI, you can read long columns in chunks. You can allocate however many
bytes you want to up front and pass that to the odefin. When you do
the fetch, there is an indicator variable that tells you how many bytes
were actually in the long raw. You can then call oflng with an
offset and fetch however many bytes you want to allow for and keep doing
this until you've gotten the full amount.
All of this works great as long as your are fetching one row at a time. I'd like to know if there is a way to do this with block fetches. If I fetch a block of 10 records and record #4 has more bytes in a long raw field than I allowed for, how do I get the rest? PLEASE HELP!
> John
>
> ________________________________________________________________
> Parallax Solutions Ltd. Tel.: 01203 514522
> Stonecourt, Fax.: 01203 514401
> Siskin Drive, Web : http://www.parallax.co.uk/~johne
> Coventry CV3 4FJ Mail: johne_at_parallax.co.uk
> ________________________________________________________________
> Kaizen - Japanese, Lit: Never ending improvement
> ________________________________________________________________
>
>
Received on Fri Oct 25 1996 - 00:00:00 CEST