Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Long Raw stores a JPG

Long Raw stores a JPG

From: Silvercup <dpierce_at_morgan.ucs.mun.ca>
Date: 1997/03/07
Message-ID: <332008FA.7632@morgan.ucs.mun.ca>#1/1

Hi there,

   I have a table that contains a field called 'IMAGE' which is of type LONG RAW,
and contains a JPG file. I am using Oracle C++ objects to access this table, and
I want to extract this JPG to a file. This is the code I have created:

		char *buff = new char[80000];
		long nread;
		FILE *fp = fopen("TEMP.JPG","wb+");

		/* dyn is the instance of the database */
		dyn.GetFieldValue("IMAGE", (void *) buff, 80000, &nread);
		fwrite(buff,nread,1,ofp);

		fclose(fp);
		delete buff;

But I can't seem to view the jpg file with lview. Am I retrieving the field
correctly, or am I missing something?

-- 
Thanks,                             | "We live in a society of laws.
David J. Pierce                     |  Why do you think I took you
Programmer Consultant               |  to see all those Police Academy 
Computing And Communications        |  movies!!!"
Memorial University Of Newfoundland |     - H. Simpson
Received on Fri Mar 07 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US