Re: Binary GIF into Oracle Database and out again

From: Richard Holowczak <holowcza_at_pegasus.rutgers.edu>
Date: 10 Feb 94 04:56:59 GMT
Message-ID: <Feb.9.23.56.59.1994.2046_at_pegasus.rutgers.edu>


g88m0396_at_hippo.ru.ac.za (J-D Mountjoy) writes:

>Hi
 

>I am using Oracle version 7 sitting on Solaris 2.2.
>What I want to do is store pictures of people (together with some data)
>in a database. The data is easy, the pictures aren't.
 

>As far as I can see, Oracle only supports RAW, and LONG RAW datatypes,
>the LONG RAW supposedly up to 65536 characters. I wrote a program that
>took the GIF and converted it into a string of hex numbers, and added
>the other stuff to make it understandable to Oracle.
>Thus I would get something like:
 

>insert into db values
>('323342342342342f234234a765e7655d765765d7657f765');
 

>but Oracle won't take it. If I try execute the file with _at_ putindata
>it just says that the string literal is tool long and it has been
>trucated.
 

>Does anybody out there know what format I should use? The manuals say
>hex ascii, which is what it is. For small strings it does work, for big
>ones not. I tried putting newlines every 80 characters but it didn't
>take that either.
 

>Thanks for any help

   I have a vague memory of a sample PRO*C program which    did just this thing under X-Windows though. CHeck your    PRO*C manuals for some ideas on this. Most of the    uses of RAW and LONG RAW I have seen use "C" and PRO*C to    do the database access and then more "C" code to display    the image.

   Also look into Oracle Forms 4.0. It may do the job    right out of the box.

Rich Holowczak
Rutgers University
holowcza_at_andromeda.rutgers.edu Received on Thu Feb 10 1994 - 05:56:59 CET

Original text of this message