You can store any type of data in a long column.. [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
Let me refine the problem:
I want to retrieve image files from my local hard drive in tables. I have the following PL/SQL code:
DECLARE
Lob_loc BFILE := BFILENAME('C:\', 'picture.tif');
BEGIN
/* Open the BFILE: */
DBMS_LOB.FILEOPEN (Lob_loc, DBMS_LOB.FILE_READONLY);
/* ...Here the file will be inserted in the table...hopefully. */
DBMS_LOB.FILECLOSE(Lob_loc);
END;
/
The path and the filename are correct. However, I get the following error:
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 475
ORA-06512: at line 1
Is DBMS_LOB.FILEOPEN trying to open a server-side file? [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
I almost forgot -- there's an Oracle Forms forum on Tek-Tips that you might find useful, I don't know how active it is (you're welcome here as well of course <grin>) [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
thanks for your reply. Yes, DBMS_LOB.FILEOPEN opens a serverside file. I've found out why the code does not work: 'C:\' is not correct. I have to create a directory object, e.g. CREATE DIRECTORY "image_dir" AS 'C:\images\'; then, instead of 'C:\', I have to use 'image_dir'. But I still don't know how to store the thing in a table....
The following line of code works for us in a forms45 trigger:-
read_image_file('c:\quickcam\latest.tif','TIFF', 'photo_photo');
^^ ^^ ^^
file name image type column name
photo_photo is the database field/column name in the form that you want to load the image into. Committing then stores the photo in the appropriate row of the table.
The photo_photo column is LONG RAW.
We use Connectix Quickcam camera and software to store the photos, always under the same file name, 'latest.tif', and immediately load it into the Oracle form and store it before taking the next photograph.
Cheers,
RogerD
You can similarly use the following to write a file out from the database:-
This should be a FAQ.... I'd vote you for TipMaster as well, but the link is missing at the moment.... <frown> [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.