image of BLOB in local directory

Hello

I want to retrieve image BLOB stored in DB to tell local directory D:/dir folder.

I've seen procedures that use UTL_FILE to do the same. but that I do not properly understand. I am getting following error. so, anyone can guide what exactly is the directory in this procedure? I assumed that where I want to transfer my images from blob.

ORA-29280: invalid directory path
ORA-06512: at "SYS." UTL_FILE", line 33
ORA-06512: at "SYS." UTL_FILE", line 436
ORA-06512: at the 'DBF '. GET_BLOB', line 16
ORA-06512: at line 2

I use oracle 10g.

You must use an Oracle Directory object with UTL_FILE.

CREATE OR REPLACE DIRECTORY temp_dir AS 'D:\temp_dir';
GRANT READ, WRITE ON DIRECTORY temp_dir TO ;

Tags: Database

Similar Questions

  • Errors during download of images in BLOB

    We have Oracle database 11g in our environment. I get errors when downloading image in BLOB. The steps are:

    1) I created the table like:

    CREATE TABLE test_image

    (

    Identification NUMBER, image_filename, VARCHAR2 (50), picture BLOB);

    2) create or replace

    PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)

    IS

    src_file BFILE.

    dst_file BLOB;

    Directory of lgh_file;

    BEGIN

    src_file: = BFILENAME ("TEST_DIR", p_image_name);

    -Open the file

    DBMS_LOB. FileOpen (src_file, DBMS_LOB.file_readonly);

    -determine the length

    lgh_file: = DBMS_LOB.getlength (src_file);

    -Read the file

    DBMS_LOB. LoadFromFile (dst_file, src_file, lgh_file);

    -update the blob field

    UPDATE test_image SET image = WHERE ID = p_id AND image_filename dst_file is p_image_name;.

    -close file

    DBMS_LOB. FileClose (src_file);

    END insert_image_file;

    3) I did an insert-insert into test_image values(1,'2.tif',null);

    4) when I call the procedure-

    Insert_image_file(1,'2.tif') EXECUTE, I get errors like:

    Error from line 7 in the command:

    EXECUTE insert_image_file(1,'2.tif')

    Error report:

    ORA-06502: PL/SQL: digital error or value: specified incorrect LOB Locator: ORA-22275

    ORA-06512: at "SYS." DBMS_LOB", line 928

    ORA-06512: at "TEST_REPORT1. INSERT_IMAGE_FILE', line 14

    ORA-06512: at line 1

    06502 00000 - "PL/SQL: digital error or the value of %s.

    * Cause:

    * Action:


    I am not able to understand what goes wrong.

    Ask for a response to my post.

    Concerning

    [oracle@localhost ~]$ ## My Operating System Details.
    [oracle@localhost ~]$ ###############################
    [oracle@localhost ~]$ uname -a
    Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Mon Mar 29 22:10:29 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
    [oracle@localhost ~]$ cd saubhik/
    [oracle@localhost saubhik]$ pwd
    /home/oracle/saubhik
    [oracle@localhost saubhik]$ ls -l *.jpeg
    -rw-r--r-- 1 oracle oinstall 1336 Mar 27 12:57 oracle1.jpeg
    -rw-r--r-- 1 oracle oinstall 2658 Mar 27 12:57 oracle2.jpeg
    [oracle@localhost saubhik]$ 
    

    Now, of the object directory configurations.

    [oracle@localhost saubhik]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 27 12:59:52 2015
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> -- Creating Directory Object.
    SQL> -----------------------------
    SQL> CREATE OR REPLACE DIRECTORY saubhik AS '/home/oracle/saubhik';
    
    Directory created.
    
    SQL> GRANT read, write, execute on DIRECTORY saubhik TO scott;
    
    Grant succeeded.
    
    SQL> 
    

    Now, your tables and procedure.

    [oracle@localhost saubhik]$ sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 27 13:31:07 2015
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> --My database version.
    SQL> ---------------------
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> DROP TABLE test_image purge;
    
    Table dropped.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1* DROP TABLE test_image purge
    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE TABLE test_image
      2    (
      3      ID             NUMBER,
      4      image_filename VARCHAR2(50),
      5      image BLOB
      6*   )
    SQL> /
    
    Table created.
    
    SQL> INSERT INTO test_image VALUES (1,'oracle1.jpeg',NULL );
    
    1 row created.
    
    SQL> INSERT INTO test_image VALUES  (2,'oracle2.jpeg',NULL  );
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace
      2  PROCEDURE insert_image_file
      3    (
      4      p_id NUMBER,
      5      p_image_name IN VARCHAR2
      6    )
      7  IS
      8    src_file BFILE;
      9    dst_file BLOB;
     10    lgh_file number;
     11  BEGIN
     12    -- update the blob field
     13    update test_image
     14    set image=empty_blob()
     15    WHERE ID = p_id AND image_filename = p_image_name
     16    returning image into dst_file
     17    ;
     18    src_file := BFILENAME
     19    (
     20      'SAUBHIK', p_image_name
     21    )
     22    ;
     23    -- open the file
     24    DBMS_LOB.fileopen
     25    (
     26      src_file, DBMS_LOB.file_readonly
     27    )
     28    ;
     29    -- determine length
     30    lgh_file := DBMS_LOB.getlength
     31    (
     32      src_file
     33    )
     34    ;
     35    -- read the file
     36    DBMS_LOB.loadfromfile
     37    (
     38      dst_file, src_file, lgh_file
     39    )
     40    ;
     41    -- close file
     42    DBMS_LOB.fileclose (src_file);
     43    commit;
     44* END insert_image_file;
     45  /
    
    Procedure created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  BEGIN
      2    insert_image_file ( 1, 'oracle1.jpeg' );
      3    insert_image_file ( 2, 'oracle2.jpeg' );
      4* END
    SQL> /
    END
      *
    ERROR at line 4:
    ORA-06550: line 4, column 3:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
    following:
    ;  
    The symbol ";" was substituted for "end-of-file" to continue.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  BEGIN
      2    insert_image_file ( 1, 'oracle1.jpeg' );
      3    insert_image_file ( 2, 'oracle2.jpeg' );
      4* END;
      5  /
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT id,image_filename,dbms_lob.getlength(image) FROM test_image;
    
            ID IMAGE_FILENAME
    ---------- --------------------------------------------------
    DBMS_LOB.GETLENGTH(IMAGE)
    -------------------------
             1 oracle1.jpeg
                         1336
    
             2 oracle2.jpeg
                         2658
    
    SQL> 
    

    Check the file size with the size of the operating system. They are the same.

  • Load a BLOB of FTP-directory object?

    Hey community members.

    I am now master the insertion of a BLOB of the file either during an INSERT or UPDATE in my local directory (C:\Oracle\Test\Pics) thanks to your
    friendly and competent help.

    but, as always ;) now I am facing another problem I thought that it would not really be a problem...

    My problem is:
    the BLOBs I want to write in my paintings are stored on an FTP server in the network and I want to access this directory when trying to create
    It's like a directory of the database as follows:
    CREATE OR REPLACE DIRECTORY image_store AS 'ftp://oracle:[email protected]/testFiles/testImages';
    username: oracle
    password: oracle

    but I can not grant access to the directory. I surfed through the net and I found several solutions for writing in a directory on the FTP server, but
    I can't understand how this is a problem to read from it. I need to create a login FTP with UTL_TCP.connection procedure?

    I found this on the net, but is it really that much "complicated"?
    -- Retrieve a binary file from a remote FTP server.
    DECLARE
      l_conn  UTL_TCP.connection;
    BEGIN
      l_conn := ftp.login('ftp.company.com', '21', 'ftpuser', 'ftppassword');
      ftp.binary(p_conn => l_conn);
      ftp.get(p_conn      => l_conn,
              p_from_file => '/u01/app/oracle/product/9.2.0.1.0/sysman/reporting/gif/jobs.gif',
              p_to_dir    => 'MY_DOCS',
              p_to_file   => 'jobs_get.gif');
      ftp.logout(l_conn);
    END;
    If so, how can I call a procedure in my procedure?


    Thanks a lot for your help and your patience!

    see you soon
    Ramirez

    An Oracle Directory object must refer to a directory which is known for the filesystem of the host operating system. A FTP location is not a valid directory object.

    The simplest approach is likely to use some of Chris Poole package XUTL_FTP. Otherwise, you'd written your own FTP package.

    Justin

  • Can you have your Local directory on your Google Reader, so that accessibility may be from anywhere?

    I would like to have Thunderbird on several computers, but has my Local directory in the cloud, so that my email is accessible from anywhere on any computer that has Thunderbird loaded with access to my Google Reader, so that the same emails in all folders, sent and Inbox can be seen, used, saved and searched?

    I think that IMAP is the best solution for sharing of mail between computers stores.

    I never recommend or advise to change the Local directory option. This detaches the question of your profile folder and complicates the management and maintenance. If you do this, please do not forget that you did it and mention if you need help.

    You can go a bit further and put your entire profile in the cloud. To do this, you must run the same version of Thunderbird on all devices, and all must have the same operating system to avoid problems of path difference and the problems of compatibility of add-on. (Since I use Linux at home but I'm forced to use Windows at work, this avenue is a non-starter for me).

    Thunderbird assumes it has the exclusive use of the profile and to this end locks your profile. Changes to the message can come from various actions; user, filters, incoming messages, changes at the level of the server being synchronized etc. The profile of locking, no action of third parties independent can disrupt things. If there is no possibility of simultaneous multiple access to your message store (i.e. using the account from multiple computers at the same time) then get ready for the data loss and corruption.

    Setting up a Bank of messages on a Cloud Computing service based is not effective. Default Thunderbird uses the format of the mailbox, where all messages in a folder are stored in one big file contiguous. So a relatively small change, such as the arrival or removal of a message of modest size means the entire file is considered as having been changed, and in general should be towards the top/downloaded in its entirety. I'm not completely sure, but I imagine that maildir storage could operate more effectively in this regard, because each message is stored in a separate file. However, maildir is a new feature in Thunderbird and has apparently some problems, so I can't recommend for general use yet.

  • How to back up the local directory/favorite in the C series or series EX with TC5.0

    Hi all

    I would like to know there is any method to safeguard the local directory/favorite in the series C or EX-series, with TC5.0. On the other hand, we have configured the root account.

    We found the local phone are stored with FolderId (localGroupId-3).

    xCommand file directory add

    Add a file to the local directory where the directory entries can be stored. Returns the file ID (localGroupId-3), which is a unique identifier of the folder.

    However, we want the exact location of the folder ID (localGroupId-3), also, is it possible to back up these files in case we need an RMA.

    Best regards

    Ben

    Hello Ben!

    That's the advantage on centrazlied directories, perhaps Cisco could implement user according to

    directories that are centralized yet stored...

    In any case, I see at least two options, you can use the administrator account tsh and run:

    xcommand search directory

    PhonebookId:

    PhonebookType:

    SearchString:

    SearchField:

    Offset: <0..65534>

    FolderId:

    Limit: <0..65534>

    Recursive:

    You may need to use recursive or other options for all entries.

    In addition, it might be easier to use the account root and PCs to download local

    the phone book file and copy on a different endpoint, its location is:

    /config/Pb.XML

    Please note the anwer using the stars below and define the thread if it is a response.

    Martin

  • If it's possible... desktop PC, I want to export data using expdp and dumpfile goes to his local directory?

    Scanario

    1 Server Machine (database software)

    2 oracle installed Client workstation

    If it's possible... desktop PC, I want to export data using expdp and dumpfile goes to his local directory?

    Rajesh

    Hello

    You can use this method

    http://dbaharrison.blogspot.de/2013/05/expdp-creating-file-on-my-local-machine.html

    But it depends on having you another instance on your workstation also.

    Otherwise, you will need to sort the database drive will appear on the desktop or vice versa using nfs/samba etc.

    See you soon,.

    Rich

  • How to CREATE a DIRECTORY using local directory

    Hi all

    I want to get some data to the local computer from the remote database service, so I use a stored procedure to get these date and save them in a file before you perform the procedure, I have to CREATE a DIRECTORY ensures that the path of the file.

    I use to CREATE a DIRECTORY on the local computer OCCI using, as: "CREATE or REPLACE DIRECTORY MSGDIR AS 'C:\test'" and I can't find the file in C:\test, I found the answer on the internet about this problem, it seems that use to CREATE a DIRECTORY on the database of service rather than on the local computer.

    Anyone know how to CREATE the local directory to use?
    Or give me advice to get the data to the local computer in my case?

    Best regards.
    It looks that CREATE DIRECTORY use the directory on the database service rather than local machine.
    

    Exactly. Where it States Furthermore?

    Anybody knows how to CREATE DIRECTORY use local directory?
    Or have any advice to get data to local machine in my case?
    

    1 all simply cannot do it. It is not possible, because this would be a serious security breach.
    2 of course, you can share the directory on the server to the network and configure a share on your local machine.
    It's so simple, most people think about it.
    You might also consider using Apex or utl_http directly.

    -----------
    Sybrand Bakker
    Senior Oracle DBA

  • Inserting image in BLOB

    Hello

    I use version 10.2.0.1.0 oracle

    My table structure is

    CREATE TABLE FARMER_IMAGE)
    FARMER_CODE VARCHAR2 (6) NOT NULL,
    F_SIGNATURE BLOB)

    I created a directory
    create or replace directory files like "C:\FARMER".

    And created a farmer of folder in the C drive of the local computer. I use windows 2003 Server software.

    By using the following procedure I try inserting image

    CREATE or REPLACE procedure Farmer_image_insert
    (P_farmer_code varchar2) as

    f_photo bfile.
    b_photo blob.
    filename varchar2 (25);
    ignore the number;

    Start

    filename: = p_farmer_code |'. TIFF';

    Update farmer_image
    Set f_signature = empty_blob()
    where farmer_code = p_farmer_code
    return f_signature in b_photo;


    f_photo: = BFILENAME ('$IMAGEFILES', filename);


    DBMS_LOB. FileOpen (f_photo, DBMS_LOB.file_readonly);
    DBMS_LOB. LoadFromFile (b_photo, f_photo, DBMS_LOB. GetLength (f_photo));
    DBMS_LOB. FileClose (f_photo);

    commit;

    END;
    /


    When running I get the message
    ORA-22288: file or LOB FILEOPEN operation failed
    The system does not have the specified path.
    ORA-06512: at "SYS." DBMS_LOB", line 523
    ORA-06512: at "DBO." " FARMER_IMAGE_INSERT', line 22


    Someone please suggest where is the error?

    Concerning
    Krishna

    Edited by: KRKP on Sep 10, 2010 20:12

    And created a farmer of folder in the C drive of the local computer.

    The directory must reside on the SERVER, not on the client side!

  • compress columns of type blob in a directory and retrieve the zip file in the APEX

    Hi all

    I have a requirement which is,

    I have a table that has a blob column I want to save all the records of the BLOB in the table in a ZIP compressed in a directory.

    Then with I have to go get this zipped file in directory and save in my local computer using APEX.

    Waiting for your answers,

    Bala

    Hi a cold sore.

    In addition to above solution to pass like a Flash of using PL/SQL blob that follows is solutions to compress blobs using Java and PL/SQL:

    NOTE: As these solution based on java solutions you require Java VM support in your database.

    Kind regards

    Kiran

  • Non-visible images by using a local server with XAMPP

    Hello

    I resurrected an old project, who has worked in the past.  Since then, Ive updated Windows (8.1) and Dreamweaver (CC) today I installed the latest XAMPP and created a folder named xamp2015.  I copied the old project (mysite) in the htdocs directory

    Now, the logic of the site works, BUT the images do not appear.

    They are stored here C:\xampp2015\htdocs\MySite\Images\Main

    My Site Local folder is C:\xampp2015\htdocs\Mysite

    Default Images folder is C:\xampp2015\htdocs\MySite\Images\

    The images will be displayed if I move them to c:\xampp2015\htdocs\MySite and update the links, but it could lead to a messy structure, which was not needed previously

    Does anyone have any suggestions?

    Try to create a new subfolder called "bob" and put a picture in it, link to it on one of your pages and see if it happens.

    In addition, which is up to the .htaccess file in your pictures folder?

  • Insert image into blob field in oracle

    Hello
    I'm below eror to insert the image file in the field of the block.


    ORA-22288: file or LOB FILEOPEN operation failed
    The system does not have the specified path.
    ORA-06512: at "SYS." DBMS_LOB", line 744

    Here's my SP:

    CREATE OR REPLACE PROCEDURE DRFSMS.iPAD_Image_Load(vParcel_ID IN VARCHAR2, vSerial_No IN NUMBER, vFileName IN VARCHAR2) IS
    l_source BFILE.
    l_dest BLOB;
    l_length directory.
    BEGIN

    l_source: = BFILENAME ("PHOTO_DIR", vFileName);

    INSERT IN WS_PARCEL_SS_IMAGES (Parcel_ID, Serial_No, fichier_image) VALUES (vParcel_ID, vSerial_No, EMPTY_BLOB ())
    RETURN fichier_image IN l_dest;
    -lock the folder
    SELECT fichier_image INTO l_dest FROM WS_PARCEL_SS_IMAGES WHERE PARCEL_ID = vParcel_ID AND Serial_No = vSerial_No FOR UPDATE;
    -Open the file
    DBMS_LOB. FileOpen (l_source, DBMS_LOB.file_readonly);
    -get the length
    l_length: = DBMS_LOB.getlength (l_source);
    -read the file and store it in the destination
    DBMS_LOB. LoadFromFile (l_dest, l_source, l_length);
    -update the blob with destination field
    UPDATE WS_PARCEL_SS_IMAGES SET fichier_image = l_dest WHERE PARCEL_ID = vParcel_ID AND Serial_No = vSerial_No;
    -close file
    DBMS_LOB. FileClose (l_source);
    END iPAD_Image_Load;

    below are the entries:

    DECLARE
    VPARCEL_ID VARCHAR2 (32767).
    NUMBER OF VSERIAL_NO;
    VFILENAME VARCHAR2 (32767).

    BEGIN
    VPARCEL_ID: = ' N00O-240';
    VSERIAL_NO: = 2;
    VFILENAME: = ' photo_dir/N00O - 222_1.jpg';

    DRFSMS. IPAD_IMAGE_LOAD (VPARCEL_ID, VSERIAL_NO, VFILENAME);
    COMMIT;
    END;

    pls someone please help me.
    thnx in advance.

    Kind regards

    Siddiq

    Published by: Siddiq on July 30, 2012 12:06

    How do you define PHOTO_DIR (which was the CREATE DIRECTORY statement)?
    Is the path to PHOTO_DIR a directory that exists on the server (and not on your client machine)?
    The user of the operating system that is running the database on the server Oracle has access to this directory on the server? Can you connect to the server as the operating system user that runs the Oracle database and open the file on the server?

    Justin

  • Absolute links on page hml in the local directory does not

    All absolute links on my html pages (which are on my hardrive) are treated as local links and are therefore not work - i.e. Firefox adds the path of the local file before the url. For example, is the original link: http://www.insidehousing.co.uk/legal/criminal-conviction-for-illegally-subletting-tenant/6518844.article

    But Firefox adds the path to the directory so the string url becomes: /www.insidehousing.co.uk/legal/criminal-conviction-for-illegally-subletting-tenant/6518844.article%E2%80%9D

    It is also added with: E2% 80 %%9D (which, when tested from a Word page, leads to the site generates but page not found error).

    For testing purposes, is there a way I can reconfigure Firefox to analyze my links as absolute?

    Thank you very much

    Hey blue88,.

    A glance through the code < a href = & # x201d; That won't work. Here's a version of your page. To avoid this happening again, I suggest that you use a text editor with syntax highlighting, as Notepad ++.

  • image of BLOB analysis

    I like this image:

    I need to create BLOB objects for every group that has more than 5 pixels, so I want to extract the pixels that are in each BLOB.

    I could do this in different applications but do not know haw to use in labview

    Glad I could help. The problem is that this case is, you use Machine Vision > detection of form instead of binary > circle detection. The difference is, instead of trying to find particles of circle inside objects, it detects only circular objects, in other words, it determines the shape of all the objects and then decides whether or not it is a circle.  In our case, this will not return any results since we circle shaped objects.

    I had very good results with the detection of 2-3 pixel RADIUS circle, based on the jpeg format, you have set up.

    Best regards:

    Andrew Valko

    NEITHER AE

  • Never backed up system before. Want to backup on CD. When the backup system, iin System Image, it does not 'local '. At only player to select. How can I save on a cd?

    Trying to backup cd my system does not give the option of backup on 'local' as shown in the video.  What it offers is DVD player.

    I never saved before.

    The DVD player is the right to choose.  You can use several DVDs CDs simply aren't enough great.  It would be more simple create a system image on an external HARD drive.

  • How to display images of blob of rest at the request of the MAF service

    Hello how are you? I am new to Oracle application development MAF and I try to display an image stored in the database with BLOB format, and I would like to know how she could show this picture in a form.

    You have a binary encoded in Base64. If you add this string before the data "imagen", " data:image/png;base64, " then you can use this string as the source attribute in the component of the image.

Maybe you are looking for

  • All in a station

    Regularly my black standard print jobs out a light gray.  I disconnect, power off, replace the cartridge (although still at half full), turning off the computer itself.  Are printed in colour, but not black.  I also cleaned the cartridges.  Sometimes

  • the hanging of the IdeaPad u 330 windows update

    Hi all I tried to search the forum, but have not found anyone having the same problem. I had my ideapad u 330 yesterday and tried to run the windows update under the settings. He said there are more than 80 updates pending. When I start it it that no

  • cannot receive e mails outlook express?

    was with tiscali, then talk of Rasht tisacali. talk, asked me to upgrade my service?, it meant a change of telephone number, so it was cancelled, I called the help line, they said that everything was as it was, now outlook express asks for my passwor

  • SONY BTF-PA402Z TV TUNER PCI MPEG II VIDEO A / V ENCODER ENX-26 VCP-IMB5A DELL D

    TV tuner not wark

  • Wanted Xepria Z2, Fan of INDIA

    Dear SONY MOBILE, Please you can exchange my new Z1 Z2 with... ?? If she has no procedure please let me know... Thanks and greetings...  and if not then let me when he is going to be in the INDIA market... Thank you best regards &... Nagesh_Noddy