DBAsupport.com Forums - Powered by vBulletin
Results 1 to 1 of 1

Thread: Dbms_filegetname Bfile

  1. #1
    Join Date
    Feb 2003
    Location
    Tehran/Iran
    Posts
    94

    Dbms_filegetname Bfile

    Hi,
    I used the following procedure to print out the locatin directory and file name without no result. It seems that the output of DBMS_LOB.FILEGETNAME is not a char format:
    ------------------------------------
    1.
    create table lobtab (
    lob_id number(2),
    lob_file BFILE)
    /

    2.
    create directory lobdir as '/home/oracle/lob_dir'
    /
    3.
    insert into lobtab
    values (1, BFILENAME('LOBDIR', 'ShowLetter.pdf'))
    /
    4.
    Procedure to find the name fo the directory and the file name:
    create or replace procedure getNameBfile is
    Dir_Name varchar2(30);
    File_Name varchar2(30);
    Lob_Loc BFILE;
    begin
    select LOB_FILE into Lob_Loc from LOBTAB where LOB_ID=1 ;
    DBMS_LOB.FILEGETNAME(Lob_Loc, Dir_Name, File_Name);
    end getNameBfile;
    /

    error message:
    *
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "ZITEC.GETNAMEBFILE", line 6
    ORA-06512: at line 1

    -----------------------------------------

    Any idea ?

    //hamhey
    Last edited by hamhey; 01-08-2004 at 03:14 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width