Results 1 to 6 of 6

Thread: doubt in LOB

  1. #1
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    doubt in LOB

    LOB


    i want doubt in lob concept
    i created one procedure in lob
    that is sucess but i having run error came.
    i sent following procedure and error also


    create or replace procedure load_pic(p_file varchar2)
    is
    v_file bfile;
    v_filename varchar2(27);
    cursor emp_pic is select id from id_pic;
    id_rec id_pic%rowtype;
    begin
    for id_rec in emp_pic loop
    v_filename :=id_rec.id|| '.jpg';
    v_file:=bfilename(p_file,v_filename);
    dbms_lob.fileopen(v_file);
    update id_pic set photo=v_file;
    DBMS_OUTPUT.PUT_LINE('LOADED FILE: '||v_filename
    || ' SIZE: ' || DBMS_LOB.GETLENGTH(v_file));
    dbms_lob.fileclose(v_file);
    end loop;
    end load_pic;

    error

    create table id_pic(id number,photo bfile);
    create directory pic_dir as 'E:\pic';
    SQL> execute load_pic('pic_dir');
    BEGIN load_pic('pic_dir'); END;
    *
    ERROR at line 1:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at "SCOTT.LOAD_PIC", line 11
    ORA-06512: at line 1


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: doubt in LOB

    For bfilename you need to pass two parameters.
    1st---name of the directory created
    2nd---name of the file

    to create a directory please use CREATE DIRECTORY command.


  3. #3
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: doubt in LOB

    Hello

    Can any one say what is relational testing?? Is this term really exist or not??????????


  4. #4
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    Re: doubt in LOB

    i already create directory
    bfile is use directory and automatic idno then

    procedure using only one parameter that is directory name

    but i do not kown error


  5. #5
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: doubt in LOB

    Either you did not create and directory from which u r picking the image or there is need to give permission on the directory u r using or the file u r opening could not be opened successfully.


  6. #6
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: doubt in LOB

    Do you have read ,write permission on the directory ?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact