Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!!How to retrieve images stored in long raw field

Status
Not open for further replies.

shetty

Technical User
May 5, 2001
7
HK
Hi everybody,

I have a problem retrieving & displaying using Forms, the images stored in an oracle table field type long raw. The images are stored in the table directly after capturing the picture using the camera.

Please help me resolving this problem....

regards
vij_shetty@yahoo.com
 
hi shetty,

What problem are you getting?
[sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
Mike here is my problem....

ORACLE 8.0.5.0

Table EMPPHOTO
(
EMPNO VARCHAR2(6)
FLAG CHAR(1)
PHOTO LONG RAW
)

Where all the all photos are stored.
The images were stored directly after capturing photo through camera using an application called ImageShare II, an image capture utility from LORONIX( the picture format used is JFIF(.JPG).

I tried using Form 4.5/5 to fetch and display & tried to write the image retrieved using WRITE_IMAGE_FILE(..) form function, but non of my attempt did work. It works when i used the same setup with another table where the images are stored from image files.

thanx & regards.
shetty
 
hi jeronimo,

Thanx for your reply, I'm using Oracle 8.0.5 ver, one you suggested is oracle 8i.

Please suggest me any other methods/links.

Thanx,
regards
shetty.
 
Shetty,

Have a look at thread186-27922

[sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
Hi shetty,

I have some LOCs which might be useful for you:

DECLARE
Lob_loc BLOB;
Buffer RAW(2700);
Amount BINARY_INTEGER := 2700;
Position INTEGER := 1;
h_var VARCHAR2(10000);
BEGIN
/* Select the LOB: */
owa_util.mime_header('image/gif');
SELECT imagefile INTO Lob_loc FROM image_storage;
LOOP
DBMS_LOB.READ (Lob_loc, Amount, Position, Buffer);
/* Display the buffer contents: */
h_var := utl_raw.cast_to_varchar2(Buffer);
htp.prn(h_var);
Position := Position + Amount;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
htp.p('<h1> Sorry, I have found no data...</h1>');
END;

This code retrieves an imagefile which is stored as BLOB in a table called image_storage. I use this code to retrieve an image and display it in a browser. (This is a sloppy code, so it might have some errors...)
Anyway, good luck!
Jeron


 
hi Jeronimo,

Thanx for quick reply.

I'm using LONG RAW in my table to store the image, I don't think DBMS_LOB will work with LONG RAW. anyway i'll let you know tomorrow.

regards
shetty.
 
hi MikeLacey,

I have seen Thread186-27922 before & I also tried, but no luck.

thanx
regards
vijay.

 
Good news, I solved my above problem.
Thanx for everyone who tried to solve my problem.

regards
vijay.
 
Shetty

Could you please post the solution ? I have similar issue
 
altquark,

Plz. post your problem in detail.

thanx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top