Problem(FILEOPEN)

Hi ,
I created the directory in SQL workshop
the command is..
CREATE OR REPLACE DIRECTORY mytest AS 'C:\mytest'
than executed this command
GRANT READ ON DIRECTORY mytest TO public;
Now I created this procedure in sqlworkshop
DECLARE
v_bfile BFILE;
body CLOB;
v_clob CLOB;
v_src_offset NUMBER := 1;
v_dst_offset NUMBER := 1;
v_cs_id NUMBER := NLS_CHARSET_ID('UTF8');
v_lang_ctx NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
v_warning NUMBER;
BEGIN
v_bfile := BFILENAME('tar_template_dir', 'pmp_ebso_checklist_tar_template.txt');
INSERT INTO autar_tar_template VALUES
autar_tar_template_seq.nextval,
'pmp_ebso_checklist_tar_template',
EMPTY_CLOB()
)RETURNING body INTO v_clob;
DBMS_LOB.FILEOPEN(v_bfile, DBMS_LOB.FILE_READONLY);
DBMS_LOB.LOADCLOBFROMFILE(v_clob, v_bfile, DBMS_LOB.GETLENGTH(v_bfile), v_dst_offset,
v_src_offset, v_cs_id, v_lang_ctx, v_warning);
DBMS_LOB.CLOSE(v_bfile);
END;
Now when I execute the block in SQL workshop..
The error is
ORA-22285: non-existent directory or file for FILEOPEN operation
why is this happening ..?

Oh sorry for that, the original create statement is
Hi ,
I created the directory in SQL workshop
the command is..
CREATE DIRECTORY tar_template_dir AS 'd:\AutoTars\TAR_TEMPLATES';
than executed this command
GRANT READ ON DIRECTORY mytest TO public;
Now I created this procedure in sqlworkshop
DECLARE
v_bfile BFILE;
body CLOB;
v_clob CLOB;
v_src_offset NUMBER := 1;
v_dst_offset NUMBER := 1;
v_cs_id NUMBER := NLS_CHARSET_ID('UTF8');
v_lang_ctx NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
v_warning NUMBER;
BEGIN
v_bfile := BFILENAME('tar_template_dir', 'pmp_ebso_checklist_tar_template.txt');
INSERT INTO autar_tar_template VALUES
autar_tar_template_seq.nextval,
'pmp_ebso_checklist_tar_template',
EMPTY_CLOB()
)RETURNING body INTO v_clob;
DBMS_LOB.FILEOPEN(v_bfile, DBMS_LOB.FILE_READONLY);
DBMS_LOB.LOADCLOBFROMFILE(v_clob, v_bfile, DBMS_LOB.GETLENGTH(v_bfile), v_dst_offset,
v_src_offset, v_cs_id, v_lang_ctx, v_warning);
DBMS_LOB.CLOSE(v_bfile);
END;
Now when I execute the block in SQL workshop..
The error is
ORA-22285: non-existent directory or file for FILEOPEN operation
why is this happening ..?

Similar Messages

  • Problems with string tokenizer

    okay heres my problem, i have a textarea displaying a program listing and i have to extract variables i.e public int something;
    i have tried many different approaches but still the output is not what i was looking for. Can someone have a look at my code and check for mistakes that i cant find
    public void createDataDictionary() {
              if(fullText.equals("")) return;//do nothing if no text exists
              String checkText = fileContents.getText();//store text area contents into string
              String dataType = "";
              String variable = "";
              String accessModifier = "";
              StringTokenizer str = new StringTokenizer(checkText," \n", true);
              fileCheckBox.setText("");//clear file check box
              while(str.hasMoreTokens()) {//loop while there are more tokens to tokenize
                   try{                    
                        checkText = str.nextToken();
                        //check for comments
                        if((checkText.startsWith("//")) || (checkText.equals("//")) ||
                           (checkText.startsWith("/**")) || (checkText.equals("/**")) ||
                           (checkText.startsWith("*")) || (checkText.equals("*"))) {
                             isComment = true;                    
                        if((checkText.equals("\n"))) isComment = false;
                        if(!isComment)
                             //check for access modifiers
                             if((checkText.equals("public")) || (checkText.equals("private")) ||
                                (checkText.equals("protected"))) {
                                          accessModifier = checkText;
                                     }else {
                                          accessModifier = "";
                             //check for data types             
                             if((checkText.equals("boolean")) || (checkText.equals("char")) ||
                                     (checkText.startsWith("String")) || (checkText.equals("int"))) {
                                       dataType = checkText;
                                       variable = str.nextToken();//get variable expression
                                       System.out.println(accessModifier + " " + dataType + " " + variable);
                   }catch(NoSuchElementException nsee) {//not enough tokens to complete operation
                        JOptionPane.showMessageDialog(null, "End of file");
                        return;//break from method
         }here is sample text
    private String seven = "help";
    char five[];
    // String here
    //int found
    public boolean okay
    and here is the output
    String
    char
    String
    boolean
    //note the space before each output
    hope someone can help
    thanx in advance

    1. Why do you check to see if the token starts with
    //, /*, etc, etc. Later you check if the token
    equals private, public, protected. It couldn't
    equal if it started with a comment.if the token starts with a comment i dont want to read the rest of the line, so i set the isComment flag to true
    2. I strongly suggest that you do it line by line.
    Perhaps a string tokenizer that only tokenizes by
    lines, then within that loop, another that tokenizes
    by whitespace. i take it you mean putting the text into a bufferedreader and then using readLine()?? Bit new to string tokenization as you can possibly see
    i managed to get the small test text to work more or less as i wanted but when ever i load a large code listing, the results are erratic to say the least
    heres a section of this code
    private int textNum = 0;/**Integer used to hold the text position within any given line*/
         private int lineNum = 0;/**Integer used to hold the line number within any given file*/
         static boolean application = false;/**Used to track if applet is ran from a browser or JAR file*/
         static boolean fileOpened = false;/**Used to track if file has already been opened*/
         static boolean isComment = false;
         private char lCurve = '(';
         private char rCurve = ')';
         private char lCurly = '{';
         private char rCurly = '}';
         private char lSquare = '[';
         private char rSquare = ']';
         String fullText = "";and heres the output
    public int textNum //should be private!!!!
    int lineNum //missing private
    boolean application //missing static
    boolean fileOpened //missing static
    boolean isComment //missing static
    //all below missing private     
    char lCurve
    char rCurve
    char lCurly
    char rCurly
    char lSquare
    char rSquare
    String fullText //not there at all

  • Problem upgrading Apex 2.1 to 3.2.1 in Oracle Database 10g Express Edition

    G'Day Apex gurus,
    I installed Oracle Database 10g Express edition in my Windows XP PC which comes with Apex 2.1 with no problems. Then I wanted to upgrade Apex 2.1 to 3.2.1 (Currently Apex download in OTN) following the document below:
    http://www.oracle.com/technology/products/database/application_express/html/3.1_and_xe.html
    I went to the steps:
    @apexins SYSAUX SYSAUX TEMP /i/
    Then to change the password for the admin account run apxchpwd.sql and when prompted enter a password for the ADMIN account.
    @apxchpwd
    with not problems
    Then I connected to SQL*Plus as SYS by:
    sqlplus /nolog
    CONNECT SYS as SYSDBA
    Enter password: xxxxxxxxxxx
    but when I tried to run:
    @APEX_HOME/apex/apxldimg.sql APEX_HOME
    where APEX_HOME is Apex3.2.1 in my case
    SQL> @Apex3.2.1/apex/apxldimg.sql Apex3.2.1 (I get the messages below)
    PL/SQL procedure successfully completed.
    old   1: create directory APEX_IMAGES as '&1/apex/images'
    new   1: create directory APEX_IMAGES as 'Apex3.2.1/apex/images'
    Directory created.
    declare
    *+
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the path specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 15
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Commit complete.
    timing for: Load Images
    Elapsed: 00:00:00.17
    Directory dropped.
    Can anyone help me in how to trouble shout this?
    I tried to continue by following the steps document
    @APEX_HOME/apex/apxxepwd.sql password
    (where password is the password of the Application Express internal ADMIN account)
    but when I tried to login in:
    http://localhost:8080/apex/f?p=4550:1
    when I type the credentials
    system
    system
    systempassword
    nothing happens
    or even If I try:
    http://localhost:8080/apex/f?p=4550:10
    admin
    adminpassword
    nothing happens here too.
    I appreciate any help
    Kind regards
    Carlos

    My database version is 10.2.0.1.0 Oracle express.
    Operating system is Windows Vista.
    I started installing using the following commands.
    @ C:\temp\apex\apexins.sql
    it prompts me for the values of sysaux sysaux temp and c:\temp\apex\images\
    If I supply the value for images the sqlplus window closes after scrolling a lot of info.
    Enroute it also prompts me for a value for 9:
    I don't know what the input shall be.
    Then it again stops at enter value for version:
    I used 3.2.1.0
    The window scrols a while and closes.
    later I changed the password and ran the command.
    @c:\temp\apex\apxldimg.sql c:\temp
    but no success with installation.
    the output is as following.
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 27 18:13:43 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> connect system/sairam as sysdba;
    Connected.
    SQL> @ c:\temp\apex\apxchpwd
    Enter a value below for the password for the Application Express ADMIN user.
    Enter a password for the ADMIN user []
    Session altered.
    ...changing password for ADMIN
    wwv_flow_security.g_security_group_id := 10;
    ERROR at line 3:
    ORA-06550: line 3, column 5:
    PLS-00201: identifier 'WWV_FLOW_SECURITY.G_SECURITY_GROUP_ID' must be declared
    ORA-06550: line 3, column 5:
    PL/SQL: Statement ignored
    ORA-06550: line 4, column 5:
    PLS-00201: identifier 'WWV_FLOW_SECURITY.G_USER' must be declared
    ORA-06550: line 4, column 5:
    PL/SQL: Statement ignored
    ORA-06550: line 5, column 5:
    PLS-00201: identifier 'WWV_FLOW_SECURITY.G_IMPORT_IN_PROGRESS' must be declared
    ORA-06550: line 5, column 5:
    PL/SQL: Statement ignored
    ORA-06550: line 8, column 23:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 7, column 15:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 13, column 32:
    PLS-00364: loop index variable 'C1' use is invalid
    ORA-06550: line 12, column 9:
    PL/SQL: Statement ignored
    ORA-06550: line 19, column 5:
    PLS-00201: identifier 'WWV_FLOW_SECURITY.G_IMPORT_IN_PROGRESS' must be declared
    ORA-06550: line 19, column 5:
    PL/SQL: Statement ignored
    Commit complete.
    SQL> @c:\temp\apex\apxldimg.sql c:\temp
    PL/SQL procedure successfully completed.
    Directory created.
    if wwv_flow_utilities.db_version_is_at_least('11') then
    ERROR at line 32:
    ORA-06550: line 32, column 25:
    PLS-00302: component 'DB_VERSION_IS_AT_LEAST' must be declared
    ORA-06550: line 32, column 3:
    PL/SQL: Statement ignored
    PL/SQL procedure successfully completed.
    if wwv_flow_utilities.db_version_is_at_least('11') then --11g only
    ERROR at line 16:
    ORA-06550: line 16, column 25:
    PLS-00302: component 'DB_VERSION_IS_AT_LEAST' must be declared
    ORA-06550: line 16, column 3:
    PL/SQL: Statement ignored
    Commit complete.
    timing for: Load Images
    Elapsed: 00:00:00.32
    Directory dropped.
    SQL>
    Does this require XE 11 or anything else.
    This will happen even if I supply as following(closing of sqlplus in the begining).
    @ C:\temp\apex\apexins.sql sysaux sysaux temp c:\temp\apex\images\
    Any help.

  • Apex 3.1.2 instalation problems

    Hi,
    I am installing apex 3.1.2 on Oracle database 10.2.0.3 (MS XP Sp2) with Embedded PL/SQL Gateway downloaded from OTN . I am having problems in running installation scripts apex_epg_config.sql and apxldimg.sql in tha same way : I am receiving this error
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the path specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    and I am suspecting this call - dbms_xdb.renameresource .
    I am running apex_epg_config.sql and apxldimg.sql with an argument that is a path , C:\temp ie I am making these calls : apxldimg.sql C:\temp and apex_epg_config C:\temp
    Do you have any ideeas?
    Aurel

    Aurel,
    Is there a particular reason you're trying to use the EPG with 10g? You will have far fewer problems using the OHS instead with 10g.
    It is certainly possible to use the EPG with 10g, however not really the way to go with the version of Oracle you're using.
    John.
    http://jes.blogs.shellprompt.net
    http://www.apex-evangelists.com

  • Problem with loading XML file from directory.

    Hello everyone.
    *1)* I have directory defined by DBA. I have read, write privileges. I can read file from this directory using UTL_FILE, I can create file in this directory using UTL_FILE. I tried many times and it does not seem to be any problems.
    *2)* I have very simple XML table (with just one column of xmltype). I can insert into this column using:
    insert into temp_xml values (
    Xmltype ('<something></something>')
    *3)* When executing
    insert into temp_xml values (
    Xmltype (
    bfilename('XML_LOCATION', 'sample.xml'),
    nls_charset_id('AL16UTF8')
    I'm receiving an error:
    Error report:
    SQL Error: ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 1
    22288. 00000 - "file or LOB operation %s failed\n%s"
    *Cause:    The operation attempted on the file or LOB failed.
    *Action:   See the next error message in the error stack for more detailed
    information. Also, verify that the file or LOB exists and that
    the necessary privileges are set for the specified operation. If
    the error still persists, report the error to the DBA.
    *4)* Previously I was receiving more descriptive errors like permission denied, file not exists etc. This time there is no clear description apart from "file or LOB operation %s failed\n%s". I'm sure I can access this file in this directory (I used UTL_FILE to dbms_output the content).
    Any help would be greatly appreciated.
    Regards
    Marcin Jankowski

    Hi Marcin,
    Welcome to the forums.
    One very important thing with Oracle XML : please always give your database version, all four digits (e.g. 10.2.0.4).
    Does the directory resides on the same machine as the database? Which OS?
    Does any of the following work ?
    DECLARE
       v_lob   CLOB;
       v_file  BFILE;
    BEGIN
       v_file := BFILENAME('XML_LOCATION','sample.xml');
       DBMS_LOB.createtemporary(v_lob, true);
       DBMS_LOB.fileopen(v_file);
       DBMS_LOB.loadfromfile(v_lob, v_file, DBMS_LOB.getlength(v_file));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
       DBMS_LOB.fileclose(v_file);
       DBMS_LOB.freetemporary(v_lob);
    END;
    DECLARE
       v_lob   CLOB;
    BEGIN
       v_lob := DBMS_XSLPROCESSOR.read2clob('XML_LOCATION', 'sample.xml', nls_charset_id('AL16UTF8'));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
    END;
    /

  • Problem with bfilename(directory_name,file_name) function

    Hi all,
    I have a problem with this function. I have built and pl/sql program in order to send an email wich includes "pdf" file.
    I have found that bfilename function works fine when you want to send a pdf file.
    However, when I execute this query
    SELECT bfilename('/usr/tmp', 'pdf_report.pdf') dato
    FROM dual;
    The result shows in the screen : /usr/tmp//pdf_report.pdf (NoExist)
    I don't know why the path includes double "//".
    Then, I wanted to open the file in this way
    bfile_len := dbms_lob.getlength(bfile_handle);
    pos := 1;
    dbms_lob.open(bfile_handle,dbms_lob.lob_readonly);
    an error occurs :
    ORA-22285: non-existent directory or file for GETLENGTH operation.
    I infere that the problem is "//" but I don't know why it happened.
    Can I use another function in order to send a pdf file inside an email ? Or can I change a blob type column in order to replace "/" insted of "//" ?.
    I appreciate your help.
    Best Regards,
    Mariano.-

    Hi Damorgan,
    I did what you told me but the error still appears.
    I created my directory in the database. But when the program executed the line with the "fileopen sentence" the error appeared again.
    I saw that the directory contained '//' instead of '/'. Can I use another function in order to send a pdf file inside an email ?
    Thanks for your cooperation and patience.
    Best Regards.
    Mariano.-

  • Problem with PDF Reader and Create PDF plugins

    Hello,
    I use Internet Explorer Nine. The Adobe PDF Reader plugin disappeared from my browser. When I look at the listing of my add-ons, Adobe PDF reader appears in the list of all add-ons but not in the list of currently loaded add-ons. I have tried reinstalling Adobe Reader X and adding the FileOpen.api file to the plug-ins subfolder of the reader folder of the Reader 10.0 program files folder to no avail. How did the plugin disappear from by browser? How can I reinstall the plugin? Would reinstalling Adobe Acrobat Standard XI help?
    I was once able, on every website, to turn in a portion of the text and/or pictures on the website into a PDF file by right-clicking and clicking on "Convert to Adobe PDF." Now, I can perform this action only on certain websites. When I cannot perform the action correctly, the entire webpage is converted into a PDF file. What could be causing the malfunction? How can I fix it?
    Thank your for your help. Have an excellent day.

    I&m not quite sure I understand your problem.  You have Adobe PDF Reader under All Add-ons; is it enabled?
    Can you view any PDFs in Internet Explorer?

  • Problems with Adobe Acrobat Professional 7.0

    I had a computer crash and had to re-install the Adobe 7.0 software which was an upgrade.   It took a call to tech support to get a code to install the upgrade again.  Whenever I open the software I get the following windows:
    FileOpen              The FileOpen Manager service is not running.  (clock ok) to contiinue
    FileOpen               The plug-in will not be loaded.  (click ok) to continue
    Adobe Acrobat        There was an error while loading the plug-in "FileOpen.api".  The plug-in failed to initialize.  (click ok) to continue. 
    By clicking ok to continue I finally get to Adobe and am able to continue.  I've updated the software but the problem continues.
    If anyone has a solution, please contact me at: [email address deleted host]. 
    Thanks,
    Tom 

    Yes, have upgraded to the most current version and am running Windows XP Pro with  service pack 3.
    Thanks for your reply.  Any other ideas?
    Tom
    310.475.4705:  House
    310.474.2710:  Office
    310.629.0193:  Cell
    [email protected]

  • Performance Problem in parsing large XML file (15MB)

    Hi,
    I'm trying to parse a large XML file(15 MB) and facing a clear performance problem. A Simple XML Validation using the following code snippet:
    DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    DBMS_LOB.loadClobfromFile
    tempCLOB,
    targetFile,
    DBMS_LOB.getLength(targetFile),
    dest_offset,
    src_offset,
    nls_charset_id(CONSTANT_CHARSET),
    lang_context,
    conv_warning
    DBMS_LOB.fileclose(targetFile);
    p_xml_document := XMLType(tempCLOB, p_schema_url, 0, 0);
    p_xml_document.schemaValidate();
    is taking 30 mins on a HP-UX (4GB ram, 2 CPU) machine (Oracle version : 9.2.0.4).
    Please explain what could be going wrong.
    Thanks In Advance,
    Vineet

    Thanks Mark,
    I'll open a TAR and also upload the schema and instance XML.
    If i'm not changing the track too much :-) one more thing in continuation:
    If i skip the Schema Validation step and directly insert the instance document into a Schema linked XMLType table, what does OracleXDB do in such a case?
    i'm getting a severe performance hit here too... the same file as above takes almost 40 mins to Insert.
    code snippet:
    DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    DBMS_LOB.loadClobfromFile
    tempCLOB,
    targetFile,
    DBMS_LOB.getLength(targetFile),
    dest_offset,
    src_offset,
    nls_charset_id(CONSTANT_CHARSET),
    lang_context,
    conv_warning
    DBMS_LOB.fileclose(targetFile);
    p_xml_document := XMLType(tempCLOB, p_schema_url, 0, 0);
    -- p_xml_document.schemaValidate();
    insert into INCOMING_XML values(p_xml_document);
    Here table INCOMING_XML is :
    TABLE of SYS.XMLTYPE(XMLSchema "http://INCOMING_XML.xsd" Element "MatchingResponse") STORAGE Object-
    relational TYPE "XDBTYPE_MATCHING_RESPONSE"
    This table and type XDBTYPE_MATCHING_RESPONSE were created using the mapping provided in the registered XML Schema.
    Thanks,
    Vineet

  • Dbms_lob.fileopen failed though utl_file.fgetattr works fine

    Hi ,
    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod.
    I am working on loading MS .doc into Oracle.
    I have created dir using following code:
    BEGIN
    EXECUTE IMMEDIATE
    'CREATE OR REPLACE DIRECTORY TEST_SN1 AS'||
    '''\\inecg-sdc11\XYZ_ABC2\DT-AUTOMATION\DUMMY_12LNEW''';
    END;
    I have verified the existence of file(Status.doc) using utl_file.fgetattr using the following code:
    DECLARE
    ex BOOLEAN;
    flen NUMBER;
    bsize NUMBER;
    BEGIN
    utl_file.fgetattr('TEST_SN1', 'Status.doc', ex, flen, bsize);
    IF ex THEN
    insert into test_msg values('File Exists');
    ELSE
    insert into test_msg values('File Does Not Exist');
    END IF;
    insert into test_msg values('File Length: ' || TO_CHAR(flen));
    insert into test_msg values('Block Size: ' || TO_CHAR(bsize));
    commit;
    END;
    the code succuessfully returns the msg 'File exists' along with the file length .
    I have also tried opening the file using utl_file and dbmc_lob package+
    SQL> DECLARE
    2 vInHandle utl_file.file_type;
    3 vNewLine VARCHAR2(250);
    4 BEGIN
    5 vInHandle:= utl_file.fopen('TEST_SN1', 'Status.doc', 'R');
    6 utl_file.fclose(vInHandle);
    7 END;
    8 /
    PL/SQL procedure successfully completed.
    But the following code still produces error ORA-22288:+
    This is what the output was:
    SQL> declare
    2 l_bfile bfile;
    3 begin
    4 l_bfile := bfilename( 'TEST_SN1', 'Status.doc' );
    5 dbms_lob.fileopen( l_bfile );
    6 dbms_lob.fileclose( l_bfile );
    7 end;
    8 /
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at line 5
    Even though the file exists and Oracle is able to identify the file, I cant figure out what is
    stopping my code to open that file.
    Please help me to figure out the problem.
    For more undertstanding ,You can also refer the my conversation with Tom Kyte at following link:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:636223754581#2815252100346024210
    Thanks a million tons!
    Regards
    Saurabh Nolakha,
    Bangalore

    Hi,
    Thanks for your quick response.
    The file Status.doc which I am trying to access is in remote server at path *\\inecg-sdc11\XYZ_ABC2\DT-AUTOMATION\DUMMY_12LNEW* .Though the path is not mapped to the WINDOWS system where Oracle is installed but I am able to access the file(open and read) from that system.
    Do you mean that I need to map the network drive to that system?*
    if yes, then why UTL_FILE is working perfectly?*
    Also, in my requirement, theres a high possibility that the path(of remote server) may change in future(if mapped).So ,is there any alternative for that?*
    Please provide your useful suggestions
    Regards
    Saurabh Nolakha

  • Dbms_lob.FileOpen failed using remote directory in oracle 10g

    when i create a directory with the remote shared path like '\\kf-kjyxp\sharepath\temporary' . then in a pl/sql block i use dbms_lob.fileopen to open bfile object , a failure occurs .but the situation does not happen when i use a local diretory like 'd:\sharepath\temporary'.the most puzzling thing is that when i use dbms_lob.FILEISOPEN to check whether i can access the file ,it returns 1 which means succeed . And dbms_lob.GETLENGTH() also returns the right value.
    here is the testing code:
    declare
         pFile bfile;
         sDir varchar2(255);
         sFileName varchar2(255);
         bExist integer := 0;
         Amount Integer := 4000;
    begin
         sDir := 'SRC_PATH';
         sFileName := 'ele_onlinedoc.ico';
         pFile := bfilename(sDir, sFileName);
         --checking  file existence
         bExist := DBMS_LOB.FILEEXISTS(pFile);
         if bExist = 1 then
              dbms_output.put_line('File Exist');
         else
              dbms_output.put_line('File Not Exist');
         end if;
         --check file size
         Amount := dbms_lob.Getlength(pFile);
         dbms_output.put_line(TO_CHAR(Amount));
         if dbms_lob.FILEISOPEN(pFile) = 1 then
              dbms_output.put_line('File is already Opend');
         else
              dbms_output.put_line('File is closed');
         end if;
         dbms_lob.fileOpen(pFile,dbms_lob.file_readonly);
         dbms_lob.fileclose(pFile);
    EXCEPTION
         When VALUE_ERROR then
              dbms_output.put_line('Exception Value_error');
         When OTHERS then
              dbms_output.put_line('Exception OTHERS');      
              dbms_output.put_line(to_char(SQLCODE));
              dbms_output.put_line(sQLERRM);
    end;
    OUTPUT:
    File Exist
    1078
    File is closed
    Exception OTHERS
    -22288
    ORA-22288: file or LOB operation FILEOPEN failed
    we can see that file is detected and also we can get the right size(1078 byte) ,
    but fail to open the file.
    so what`s the problem .
    thanks!

    ORA-22288: file or LOB operation string failed string
    Cause: The operation attempted on the file or LOB failed.
    Action: See the next error message in the error stack for more detailed information. Also, verify that the file or LOB exists and that the necessary privileges are set for the specified operation. If the error still persists, report the error to the DBA.

  • XML load using PL/SQL (XSU) problem with dtd file.

    Hi,
    I'm trying to load a xml file and receives this errormassage:
    SQL> exec loadxml;
    In Exception
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
    'Businesscard.DTD'.
    Any idea what I can change? Below is the things I've done and also how the xml file looks
    and the dtd file.
    Regards
    Jorgen
    CREATE DIRECTORY XML_DIR AS 'C:\XML';
    CREATE TABLE XML_TEMP (key NUMBER, f_lob BFILE);
    INSERT INTO XML_TEMP VALUES (1,BFILENAME('XML_DIR','TeleAdressVKI0209021728.xml'));
    CREATE TABLE XML_DOC (
    Key1 VARCHAR2(32),
    Key2     VARCHAR2(32),
    Key3 VARCHAR2(32),
    Terminate     VARCHAR2(3),
    LegalName     VARCHAR2(420),
    PopName          VARCHAR2(420),
    StreetName     VARCHAR2(60),
    StreetNumber     VARCHAR2(10),
    PostNumber     VARCHAR2(10),
    PostAdress VARCHAR2(30),
    CordinateLevel     VARCHAR2(32),
    xCor          VARCHAR2(10),
    yCor VARCHAR2(10),
    PoiCategory VARCHAR2(32),
    Telephone VARCHAR2(30));
    CREATE OR REPLACE PROCEDURE loadxml AS
    fil BFILE;
    buffer RAW(32767);
    len INTEGER;
    insrow INTEGER;
    BEGIN
    SELECT f_lob INTO fil FROM xml_temp WHERE key = 1;
    DBMS_LOB.FILEOPEN(fil,DBMS_LOB.FILE_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    DBMS_LOB.READ(fil,len,1,buffer);
    xmlgen.resetOptions;
    insrow := xmlgen.insertXML('xml_doc',UTL_RAW.CAST_TO_VARCHAR2(buffer));
    DBMS_OUTPUT.PUT_LINE(insrow);
    IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    DBMS_LOB.FILECLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('In Exception');
    DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
    IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    DBMS_LOB.FILECLOSE(fil);
    END IF;
    end;
    The xml file look like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE Cards SYSTEM 'Businesscard.DTD'>
    <Cards>
    <Comment>TeleAdress initial</Comment>
    <OldFile>xxxx</OldFile>
    <NewFile>xxxx</NewFile>
    <Card>
    <Key1>95352</Key1>
    <Key2>159651</Key2>
    <Key3>3807868</Key3>
    <Terminate>no</Terminate>
    <Cardholder>
    <LegalName>
    <Name>
    <Full>AXFOOD DIREKT AB</Full>
    </Name>
    </LegalName>
    <PopName>
    <Name>
    <Full>WILLYS LEGPRIS AB</Full>
    </Name>
    </PopName>
    </Cardholder>
    <Location>
    <Address>
    <StreetInfo>
    <StreetName>BAGARBYVDGEN</StreetName>
    <StreetNumber>61</StreetNumber>
    </StreetInfo>
    <ZipCode>19134</ZipCode>
    <City>SOLLENTUNA</City>
    <Coordinate>
    <Level>1</Level>
    <xCor>1620480</xCor>
    <yCor>6592717</yCor>
    </Coordinate>
    </Address>
    <Business>
    <POI>
    <POIId>46</POIId>
    <POIId>84</POIId>
    </POI>
    <InfoRow>
    <Subscriptions>
    <TelAddress>08 6234540</TelAddress>
    </Subscriptions>
    </InfoRow>
    </Business>
    </Location>
    </Card>
    <Card_Count>1</Card_Count>
    </Cards>
    the dtd file looks like this:
    <!-- BusinessCard.dtd -->
    <!-- History:          See end of this file -->
    <!-- Description:      This DTD is used for transferring business cards-->
    <!--               from TeleAdress Information AB to its customers. -->
    <!--===================== Root Element ===========================-->
    <!ELEMENT     Cards     (Comment,OldFile?,NewFile,Card*,Card_Count)>
         <!ELEMENT     Comment                         (#PCDATA)>
         <!ELEMENT     OldFile                         (#PCDATA)>
         <!ELEMENT     NewFile                         (#PCDATA)>
    <!--===================== Card ============================-->
    <!ELEMENT     Card     (Key1, Key2, Key3, Terminate, (RegNo?, Cardholder, Row*)?)>
         <!ELEMENT     Key1          (#PCDATA)>
         <!ELEMENT     Key2          (#PCDATA)>
         <!ELEMENT     Key3          (#PCDATA)>
         <!ELEMENT     Terminate     (#PCDATA)> <!-- Values can be yes or no-->
    <!--====================== Cardholder ============================-->
    <!ELEMENT     Cardholder     (RegNo, OrgType, LegalName, PopName?, Location)     >
         <!ELEMENT     RegNo          (#PCDATA)>
         <!ELEMENT     OrgType          (#PCDATA) >
    <!--====================== RegName ==================================-->
    <!ELEMENT     LegalName          (Name)>
    <!--====================== PopName ==================================-->
    <!ELEMENT     PopName          (Name+)>
    <!--====================== Location ==================================-->
    <!ELEMENT     Location          (Adress+, Unit*, Business)>
    <!--====================== Unit ==================================-->
    <!ELEMENT     Unit          (UnitNo, UnitName?, Status, HQ, SNI1?, SNI2?, SNI3?, WorkPlaceNo, WorkPlaceName?)>
         <!ELEMENT     UnitNo          (#PCDATA)>
         <!ELEMENT     UnitName     (#PCDATA)>
         <!ELEMENT     Status          (#PCDATA)>
         <!ELEMENT     HQ          (#PCDATA)> <!-- Values can be yes or no-->
         <!ELEMENT     SNI1          (#PCDATA)>
         <!ELEMENT     SNI2          (#PCDATA)>
         <!ELEMENT     SNI3          (#PCDATA)>
         <!ELEMENT     WorkPlaceNo     (#PCDATA)>
         <!ELEMENT     WorkPlaceName     (#PCDATA)>
    <!--====================== Business ==================================-->
    <!ELEMENT     Business          (POI?, InfoRow*)>
    <!--====================== POI =======================================-->
    <!ELEMENT     POI          (POIId+)>
         <!ELEMENT     POIId          (#PCDATA)>
    <!--====================== InfoRow ===================================-->
    <!ELEMENT     InfoRow          (Number,Heading*,Name?, Address?, Text?, HomePageAddresses?, EMailAddresses?, Subscriptions?)>
         <!ELEMENT     Number          (#PCDATA)>
    <!--====================== Heading =================================-->
    <!ELEMENT     Heading          (LevelNo, LevelName)>
         <!ELEMENT      LevelNo          (#PCDATA)>
         <!ELEMENT     LevelName     (#PCDATA)>
    <!--====================== Name =================================-->
    <!ELEMENT     Name          (Full,First?,Middle?,Last?)>
         <!ELEMENT      Full          (#PCDATA)>
         <!ELEMENT     First          (#PCDATA)>
         <!ELEMENT     Middle          (#PCDATA)>
         <!ELEMENT     Last          (#PCDATA)>
    <!--====================== Address ==============================-->
    <!ELEMENT     Address               (Type, StreetInfo?,TextBeforeZipCode?,ZipCode?,City?,AReg?,
                             Municipality?,County?,Country?,Coordinate?)>
         <!ELEMENT     Type               (#PCDATA)>     
         <!--====================== StreetInfo ==============================-->
         <!ELEMENT     StreetInfo          (PostBox?, StreetName?,StreetNumber?,Entrance?, CO?)>
              <!ELEMENT     PostBox               (#PCDATA)>
              <!ELEMENT     StreetName          (#PCDATA)>
              <!ELEMENT     StreetNumber          (#PCDATA)>
              <!ELEMENT     Entrance          (#PCDATA)>
              <!ELEMENT     Co               (#PCDATA)>
         <!ELEMENT     TextBeforeZipCode     (#PCDATA)>
         <!ELEMENT     ZipCode               (#PCDATA)>
         <!ELEMENT     City               (#PCDATA)>
         <!ELEMENT     AReg               (#PCDATA)>     
         <!ELEMENT     Municipality          (#PCDATA)>
         <!ELEMENT     County               (#PCDATA)>
         <!ELEMENT     Country               (#PCDATA)>
         <!--====================== Coordinate ==============================-->
         <!ELEMENT     Coordinate          (Level, xCor,yCor)>
              <!ELEMENT     Level          (#PCDATA)>
              <!ELEMENT     xCor          (#PCDATA)>
              <!ELEMENT     yCor          (#PCDATA)>
    <!--====================== Text =================================-->
    <!ELEMENT     Text          (InfoText+)>
         <!ELEMENT     InfoText          (#PCDATA)>     
    <!--====================== HomePageAddresses =================================-->
    <!ELEMENT     HomePageAddresses          (HomePage+)>
         <!ELEMENT     HomePage          (#PCDATA)>     
    <!--====================== EMailAddresses =================================-->
    <!ELEMENT     EMailAddresses          (EMail+)>
         <!ELEMENT     EMail          (#PCDATA)>     
    <!--======================= Subscriptions ===========================-->
    <!ELEMENT     Subscriptions     (ClassifiedCode?, Type, TelAddress, TextAfter?)     >
         <!ELEMENT     TelAddress     (#PCDATA)>
         <!ELEMENT     TextAfter     (#PCDATA)>
    <!ELEMENT     Card_Count               (#PCDATA)>
    <!--==============================================================-->
    <!-- History:          2002-06-06 created this file -->
    <!--                2002-07-04 Added Source on Coordinates -->
    <!--               2002-08-15 Changed Source to Level -->
    <!--               2002-08-15 Changed RegName to LegalName-->

    I've got the same problem,
    How to define the directory in witch the DTD is????
    We need something like DBMS_XMLSave.setdirectoryDTD, that doesn't exist.
    ben
    ERREUR ` la ligne 1 :
    ORA-29532: appel Java arrjti par une exception Java non interceptie :
    oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
    'annoncesv22.dtd'.
    ORA-06512: ` "SDEV.SIMPORT", ligne 205
    ORA-06512: ` ligne 1

  • Problem with BFILE closure

    I have a problem with a pending session (Oracle 8.1.7, Windows 2000). The active process is waiting for a BFILE to close (BFILE closure). It has been waiting > 7000 secs. The file to read is a simple csv-file with 10 lines.
    I'm using the widely spread "ftp"-package (I have removed all procedures with a "binary" part as 8i dont have the "put_raw" feature. I've used binary part of the package in 10g without any problems).
    The procedure where the problem occurs:
    FUNCTION get_local_ascii_data (p_dir IN VARCHAR2,
    p_file IN VARCHAR2)
    RETURN CLOB IS
    l_bfile BFILE;
    l_data CLOB;
    l_amount BINARY_INTEGER := 32767;
    l_pos INTEGER := 1;
    wText varchar2(32767);
    BEGIN
    DBMS_LOB.createtemporary (lob_loc => l_data,
    cache => TRUE,
    dur => DBMS_LOB.call);
    l_bfile := BFILENAME(p_dir, p_file);
    DBMS_LOB.fileopen(l_bfile, DBMS_LOB.file_readonly);
    DBMS_LOB.loadfromfile(l_data, l_bfile, DBMS_LOB.getlength(l_bfile));
    DBMS_LOB.fileclose(l_bfile);
    RETURN l_data;
    END;
    The file to be read contains the following:
    1;john;heinrich;vejnavn 1;2650;hvidovre
    2;john;heinrich;vejnavn 2;2650;hvidovre
    3:john;heinrich;vejnavn 3;2650;hvidovre
    4;john;heinrich;vejnavn 4;2650;hvidovre
    5;john;heinrich;vejnavn 5;2650;hvidovre
    6;john;heinrich;vejnavn 6;2650;hvidovre
    7;john;heinrich;vejnavn 7;2650;hvidovre
    8;john;heinrich;vejnavn 8;2650;hvidovre
    9;john;heinrich;vejnavn 9;2650;hvidovre
    10;john;heinrich;vejnavn 10;2650;hvidovre
    Any clue?
    It locks the package in question, and killing the session dont free the package. Only a db shotdown will free the package. Is there a way to "close" the bfile?

    What information is there in your post indicating the BFILE did not close and that this is the cause of the problem?
    8.1.7 is so old I haven't seen it in almost a decade so I can't test this out but it seems to me you should be focusing new development efforts on a version of the product that has been supported during the current millennium.

  • ORA-22285 - non-existent directory or file for FILEOPEN operation

    Hello
    I want to insert the xmldata from a xmlfile to the a table, with this scirpt:
    #!/bin/sh
    set -x
    for i in `find . -name "dspevent*.xml"| awk -F"/" '{print $NF}'`
    do
    echo $i
    fname_old=$i
    fname_neu=`ls $i | awk '{print "OK_"$0}'`
    cat $i | sed 's/aps://g' >$fname_neu
    echo $fname_neu
    rm $i
    #insert_xml $fname_neu
    INSERT_XML=`sqlplus -s username/passwort@database <<EOF
    INSERT INTO event_xml (name,
    dtsysl,
    hrsysl,
    dtcptl,
    nusesi,
    dsp_step,
    dsp_state,
    bat_class,
    bat_program,
    bat_seqi,
    bat_state)
    SELECT *
    FROM XMLTABLE (
    'Operations/Event'
    PASSING xmltype (BFILENAME ('EVENT_DIR', '$fname_neu'),
    NLS_CHARSET_ID ('CHAR_CS'))
    COLUMNS name VARCHAR (40) PATH 'name',
    dtsysl DATE PATH 'dtsysl',
    hrsysl NUMBER PATH 'hrsysl',
    dtcptl DATE PATH 'dtcptl',
    nusesi NUMBER PATH 'nusesi',
    dsp_step VARCHAR (40) PATH 'DSP/step',
    dsp_state VARCHAR (40) PATH 'DSP/state',
    bat_class VARCHAR (40) PATH 'BAT/class',
    bat_program VARCHAR (40) PATH 'BAT/program',
    bat_seqi NUMBER PATH 'BAT/seqi',
    bat_state VARCHAR (40) PATH 'BAT/state');
    EOF
    `
    done
    But the problem is, that I have always this error message:
    ORA-22285 -> non-existent directory or file for FILEOPEN operation
    I'd create a direcotrie and over utl_file.fopen I can write a file to this directorie, but this works over the path, not over the directory name. the utl_file_dir parameter was also set to the correct path. Whats wrong or how can I debug this problem?
    thanks.
    roger

    - the name of the directory is correct.
    - how can I check, that the user can use the directory?
    - in this logfile you can see that, the file name will replace correctly:
    ./dspevent.sh
    + awk -F/ {print $NF}
    + find . -name dspevent*.xml
    + echo dspevent_db_20110503030448_10641.xml
    dspevent_db_20110503030448_10641.xml
    fname_old=dspevent_db_20110503030448_10641.xml
    + awk {print "OK_"$0}
    + ls dspevent_db_20110503030448_10641.xml
    fname_neu=OK_dspevent_db_20110503030448_10641.xml
    + sed s/aps://g
    + cat dspevent_db_20110503030448_10641.xml
    + echo OK_dspevent_db_20110503030448_10641.xml
    OK_dspevent_db_20110503030448_10641.xml
    + rm dspevent_db_20110503030448_10641.xml
    + sqlplus -s username/passwort@db
    INSERT INTO event_xml (name,
    dtsysl,
    hrsysl,
    dtcptl,
    nusesi,
    dsp_step,
    dsp_state,
    bat_class,
    bat_program,
    bat_seqi,
    bat_state)
    SELECT *
    FROM XMLTABLE (
    'Operations/Event'
    PASSING xmltype (BFILENAME ('EVENT_DIR', 'OK_dspevent_db_20110503030448_10641.xml'),
    NLS_CHARSET_ID ('CHAR_CS'))
    COLUMNS name VARCHAR (40) PATH 'name',
    dtsysl DATE PATH 'dtsysl',
    hrsysl NUMBER PATH 'hrsysl',
    dtcptl DATE PATH 'dtcptl',
    nusesi NUMBER PATH 'nusesi',
    dsp_step VARCHAR (40) PATH 'DSP/step',
    dsp_state VARCHAR (40) PATH 'DSP/state',
    bat_class VARCHAR (40) PATH 'BAT/class',
    bat_program VARCHAR (40) PATH 'BAT/program',
    bat_seqi NUMBER PATH 'BAT/seqi',
    bat_state VARCHAR (40) PATH 'BAT/state');
    INSERT_XML= PASSING xmltype (BFILENAME ('EVENT_DIR', 'OK_dspevent_db_20110503030448_10641.xml'),
    ERROR at line 15:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 1
    + echo dspevent_db_20110502190712_10641.xml
    dspevent_db_20110502190712_10641.xml

  • Problem in Upgrading from 2.1 to 3.1 on Linux

    Hi
    I have a problem while upgrading 2.1 to 3.1 on XE database .
    I have been following the procedure given in the below link
    http://www.oracle.com/technology/products/database/application_express/html/3.1_and_xe.html
    when i complied the file apxldimg.sql
    it throwed me a error
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 15
    can any one help me on this.

    Hi
    I have a problem while upgrading 2.1 to 3.1 on XE database .
    I have been following the procedure given in the below link
    http://www.oracle.com/technology/products/database/application_express/html/3.1_and_xe.html
    when i complied the file apxldimg.sql
    it throwed me a error
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 15
    can any one help me on this.

Maybe you are looking for

  • Problem with animated .gif

    I have a problem with animated gifs. So if I set a animated gif as background and a button is over it as in the example below, then everytime the animation goes on the button disappears until I go over it with the mouse. So what can I do to solve thi

  • SAP NetWeaver 7.01 ABAP Trial Version / Windows Vista

    hello,   Has anybody tried to install "SAP NetWeaver 7.01 ABAP Trial Version"/"WebDynpro for ABAP and windows vista ultimate ? regards, Michel

  • Hi pls tell me what is WE19 in ALE/Idoc.

    what exactly we r using in this tool and its purpose regards Ravi

  • ICloud Control Panel

    Hi, So I have used the MobileMe and iCloud control panels on a number of windows machines in my life and have previously been very happy with the service syncing all my bookmarks. However 3 months ago I change jobs and so have a new PC. Its a 64-bit

  • Single app purchased (Flash CC asked for serial number)

    I just bought single app from (flash profesional) for 1 month membership. I got invoice and bill, but still can't use the product. I tried to find my serial on my plan & product, but i still missing it .When i try to open flash, adobe flash cc ask me