Invalid Directory Path Error

Hi Guys i am executing the following commands to create a directory and to put a file in the newly created directory, it is givig error of invalid directory path.
create directory dir_output as 'D:\Ora_Applications\'
grant read, write on directory dir_output to public
create or replace procedure Write_to_File
IS
f utl_file.file_type;
begin
f := utl_file.fopen('dir_output', 'something.txt', 'w');
utl_file.put_line(f, 'line one: some text');
utl_file.put_line(f, 'line two: more text');
utl_file.fclose(f);
end;
when i execute the procedure it gives the following error:
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 424
ORA-06512: at "SCOTT.WRITE_TO_FILE", line 5
ORA-06512: at line 1
Please help me out of it.
Regards,
Imran Baig

f := utl_file.fopen('dir_output', 'something.txt', 'w');Directory name must be uppercase. Try
f := utl_file.fopen('DIR_OUTPUT', 'something.txt', 'w');

Similar Messages

  • UTL_file Procedure- some error on invalid directory path

    Hi,
    I Created a file procedure...but while executing a procedure its showing directory Error....
    Find the solution and post it...
    Heading 2: h2. ERROR -29280ORA-29280: invalid directory path
    create or replace
    PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('C:\','HELLO.TXT','a');
    UTL_FILE.PUT_LINE(v_MyFileHandle,'Hello World! ' || TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
    UTL_FILE.FCLOSE(v_MyFileHandle);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR ' || TO_CHAR(SQLCODE) || SQLERRM);
    NULL;
    END;

    This is the spec of fopen:
    UTL_FILE.FOPEN (
       location     IN VARCHAR2,
       filename     IN VARCHAR2,
       open_mode    IN VARCHAR2,
       max_linesize IN BINARY_INTEGER)
      RETURN file_type;
    Location is not "c:\" but a directory object name. See the pl/sql manual:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_file.htm

  • UTL_FILE errors,  invalid directory path ???

    Hi All,
    I am trying to create a csv output file through pl/sql.
    However i am having some issues since its my first time.
    Please have a look at the following code:
    create or replace
    PROCEDURE amer_main_proc (start_sent_date date,
                        end_sent_date date,
                        senttype number) IS
    CURSOR main_cur IS
    SELECT
              s.sent_id,
              s.ussc_id,
              s.sent_upd_date,
              s.alt_docket,
              s.amend_year,
              s.def_num,
              s.dep_status_code,
              s.var_status_code,
              s.disp_type_code,
              s.docket,
              s.oth_sent_code,
              substr(s.oth_text,1,100) oth_text,
              s.po_code,
              ind.prim_offn_code,
              s.prob_mons
    FROM      sentences s,
              submission sub,
              ind_sent ind,
              defendants def,judges j
    WHERE      s.sent_id = sub.sent_id
    AND      s.sent_id = ind.sent_id
    AND      ((sub.case_type_code in (10,11) 
    AND      trunc(sent_vio_date) between start_sent_date and end_sent_date) or
              (sub.case_type_code in (10)  AND trunc(sent_vio_date) between start_sent_date and end_sent_date) or
              (sub.case_type_code in (11) AND trunc(sent_vio_date) between start_sent_date and end_sent_date) or
              (sub.case_type_code in (11) and  s.amend_code = 10 AND trunc(sub.create_date) between start_sent_date and end_sent_date))
              AND s.def_id=def.def_id
              AND s.ao_judge_id = j.ao_judge_id
              AND sent_creator_id is not null
              AND dist_id != 99
    ORDER BY s.ussc_id, s.sent_id;
    --Define output file variables
    out_file UTL_FILE.FILE_TYPE;        /* file type */
    path_name VARCHAR2(50);            /* file path */
    file_name VARCHAR2(50);            /* file name */
    line_buffer VARCHAR2(2000);        /* store all the elements that make up one line in the output file */
    BEGIN
        path_name := 'C:\SQL';  // this folder does exist in my C drive
        file_name := 'main.txt';
        out_file := UTL_FILE.FOPEN(path_name, file_name, 'W');
        line_buffer := 'data main;';
        UTL_FILE.PUT_LINE (out_file, line_buffer);
        line_buffer := 'infile cards delimiter='','';';
        UTL_FILE.PUT_LINE (out_file, line_buffer);
        line_buffer := 'input ' ||
        'USSCIDN ' ||
        'ALT1DOC $ ' ||
        'DEPART ' ||
        'VARIAN ' ||
        'DISPOSIT ' ||
        'DOCKETID $ ' ||
        'TYPEOTHS ' ||
        'TYPEOTTX $ ' ||
        'POOFFICE $ ' ||
        'MONOFFTP ' ||
        'PROBATN ';
        UTL_FILE.PUT_LINE (out_file, line_buffer);
        FOR main_cur_rec IN main_cur LOOP
         --Writes to file
              line_buffer := main_cur_rec.ussc_id ||
              ',' || nvl(main_cur_rec.alt_docket,' ') ||
              ',' || nvl(to_char(main_cur_rec.dep_status_code),' ') ||
              ',' || nvl(to_char(main_cur_rec.var_status_code),' ') ||
              ',' || nvl(to_char(main_cur_rec.disp_type_code),' ') ||
              ',' || nvl(main_cur_rec.docket,' ') ||
              ',' || nvl(to_char(main_cur_rec.oth_sent_code),' ') ||
              ',' || nvl(main_cur_rec.oth_text,' ') ||
              ',' || nvl(to_char(main_cur_rec.po_code),' ') ||
              ',' || nvl(to_char(main_cur_rec.prim_offn_code),' ') ||
              ',' || nvl(to_char(main_cur_rec.prob_mons),' ');
              UTL_FILE.PUT_LINE (out_file, line_buffer);
         END LOOP;
         --Write SAS footer
         line_buffer := ';';
         UTL_FILE.PUT_LINE (out_file, line_buffer);
         line_buffer := 'run;';
         UTL_FILE.PUT_LINE (out_file, line_buffer);
         --Close file
         UTL_FILE.FCLOSE(out_file);
    EXCEPTION
    -- Write error messages to the screen and file
        WHEN OTHERS THEN
        DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,1,50));     // this is line 106
        UTL_FILE.PUT_LINE(out_file, SUBSTR(SQLERRM,1,50));
       UTL_FILE.FCLOSE(out_file);
    END amer_main_proc;I know I am having issues regarding the path, please have a look at the ERRORS below:
    Error starting at line 1 in command:
    DECLARE
      START_SENT_DATE DATE;
      END_SENT_DATE DATE;
      SENTTYPE NUMBER;
    BEGIN
      START_SENT_DATE := '01-JAN-2001';
      END_SENT_DATE := '01-MAR-2001';
      SENTTYPE := 10;
      AMER_MAIN_PROC(
        START_SENT_DATE => START_SENT_DATE,
        END_SENT_DATE => END_SENT_DATE,
        SENTTYPE => SENTTYPE
    END;
    Error report:
    ORA-29282: invalid file ID
    ORA-06512: at "SYS.UTL_FILE", line 878
    ORA-06512: at "USSC_CASES.AMER_MAIN_PROC", line 106
    ORA-29280: invalid directory path
    ORA-06512: at line 10
    29282. 00000 -  "invalid file ID"
    *Cause:    A file ID handle was specified for which no corresponding
               open file exists.
    *Action:   Verify that the file ID handle is a value returned from a
               call to UTL_FILE.FOPEN.thanks guys.
    Edited by: Rooney on Feb 20, 2012 12:29 PM

    You'll need to create an Oracle Directory object that contains 'C:\SQL' and use that in your UTL_FILE call if you are using a 10g+ version of the database and the UTL_FILE_DIR parameter does not include your path.
    CREATE DIRECTORY my_dir AS 'C:\SQL';
    GRANT READ WRITE ON DIRECTORY my_dir TO <user>;You can then use the directory object name in the path of your UTL_FILE call.
    ORA-29280: invalid directory path Cause: A corresponding directory object does not exist.
    Action: Correct the directory object parameter, or create a corresponding directory object with the CREATE DIRECTORY command.>
    Hope this helps!

  • Invalid directory path due to missing pathe under parameters table

    I have created directory xyz & also data being appeared under the privilege table.
    But problem is that how that directory path would be added through command in parameter table as mentioned.
      select *  from v$parameter where name = 'utl_file_dir';
     

    Mentioned stepts.
    --created directory
    create directory XX_HRMS as '/apps/hrms'
    --check wheather directory has been created or not
    SELECT * FROM dba_directories where directory_name = 'XX_HRMS'
    OWNER  DIRECTORY_NAME     DIRECTORY_PATH
    1     SYS     XX_HRMS     /apps/hrms
    --check privilages
    SELECT *   FROM DBA_tab_privs WHERE table_name = 'XX_HRMS'
       GRANTEE  OWNER  TABLE_NAME  GRANTOR  PRIVILEGE  GRANTABLE  HIERARCHY
    1  SYSTEM  SYS  XX_HRMS  SYS  READ  YES  NO
    2  SYSTEM     SYS     XX_HRMS     SYS     WRITE     YES     NO
    3     APPS     SYS     XX_HRMS     SYSTEM     READ     NO     NO
    4     APPS     SYS     XX_HRMS     SYSTEM     WRITE     NO     NO
    --- using this directory
    declare
    output_file utl_file.file_type;
    v_file_name  varchar2(100) := 'abc.tx';
      begin         
       output_file := utl_file.fopen ('/apps/hrms',v_file_name, 'W');
            utl_file.put_line (output_file,' insert my new line ');   
           UTL_FILE.FCLOSE(output_file);
    END;
    --- when i run of above pl-script then system raise an error.
    ORA-29280: invalid directory path Pls guide me.
    thanks

  • Invalid Directory Path

    Hi,
    When I execute a procedure as shown below i use to get an error as
    <b> "invalid directory path"</b>
    exec emp_details('c:\emp\test.txt',100);
    The first parameter is the the path where file is stored and the other parameter is the emp code.
    After executing the procedure the error message is,
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 424
    ORA-06512: at "emp_details", line 34
    ORA-06512: at line 1
    but actually the file is located in the mentioned path but still the error occurs.
    Please help me in this regard.

    Hello
    Did you create a directory object or are you relying on utl_file_dir?
    You may need to upper case the path if you are using a directory object (I think). Also, utl_file.f_open takes in the path AND the file name, not just the file name on it's own. Are you correctly splitting the file name from the path?
    It might help if you can show the relevant parts of the procedure that are failing.
    HTH
    David

  • 10g : WriteToFile always fails with 'invalid directory path'

    Oracle 10.1.0.3.0
    Microsoft Windows XP Service Pack 2
    I can't use XMLDOM.writeToFile. Always fails with 'invalid directory path' :
    SQL> create directory c_root as 'C:\';
    Directory created.
    SQL>
    SQL> declare
    2 doc xmldom.DOMDocument;
    3 root_elmt xmldom.DOMElement;
    4 begin
    5 doc := xmldom.newDOMDocument;
    6
    7 root_elmt := xmldom.createElement(doc, 'MessageBatch');
    8
    9 xmldom.writeToFile(doc, 'C:\docSample.xml');
    10 xmldom.freeDocument(doc);
    11
    12 end;
    13 /
    declare
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 86
    ORA-06512: at "XDB.DBMS_XMLDOM", line 4451
    ORA-06512: at line 9
    This happens with any OS directory with write permission for Everyone.
    Also tried with UTL_FILE_DIR = *, same outcome...
    Thanks in advance,
    Hugo Leote

    Look like bug 4477774. A possible workaround, somewhat unsafe, is to set UTL_FILE_PATH to '*', which will require a server restart. You then specifiy the path with unix style '/' rather than dos style '\'. You may also be able to use a path with unix style '/' rather than '*', although the bug description does not make this clear.

  • Netca result in CRS-0241: invalid Directory path.

    I did install clusterware and db binaries. When started netca, got following error...
    linux1:(oracle):rac1> netca
    Oracle Net Services Configuration:
    Configuring Listener:LISTENER
    linux1...
    linux2...
    problem in configuration: Nodes(s): linux1: CRS-0241: invalid Directory path.
    Nodes(s): linux2: CRS-0241: invalid Directory path.
    Any help appreciated..Thanks...

    or Just follow the below steps:
    1. As root on each application node, bring in the Oracle environment:
    . ~oracle/.bashrc (Linux)
    OR
    . /home/oracle/.profile (Solaris x86)
    2. Change the owner of $CRS_HOME/crs; this prevents error CRS-0241, Invalid directory path:
    chown oracle:oinstall $CRS_HOME/crs
    3. From an X-Windows application, log into the lowest-numbered application node as the oracle user.
    4. Change to the directory that contains the tns information:
    cd $TNS_ADMIN
    5. If you are going to use an existing database, make a copy of the tnsnames.ora file:
    cp -p tnsnames.ora tnsnames.ora.bk
    6. Remove the tnsnames.ora file:
    rm -f listener.ora tnsnames.ora
    7. Run netca, taking all defaults.
    Best regards,
    Pandian

  • Invalid directory path for windows...?

    DECLARE
    v_file UTL_FILE.FILE_TYPE;
    v_dir VARCHAR2(250);
    v_filename VARCHAR2(50);
    BEGIN
    v_dir := 'D:/LANDMARK/datamigration';
    v_filename := 'pc_datamigration_out';
    v_file := UTL_FILE.FOPEN(v_dir, v_filename, 'w');
    UTL_FILE.PUT_LINE(v_file, 'Test file for usage of UTL_FILE package');
    UTL_FILE.FCLOSE(v_file);
    exception
    when others then
    dbms_output.put_line('Err utl file..!'||sqlerrm);
    END;
    I am getting eror "Err utl file..!ORA-29280: invalid directory path"
    kindly help me to fix problem.I am working on windows machine not on unix.
    rgds,
    pc

    The correct thing to do is to create a directory object e.g.:
    CREATE OR REPLACE DIRECTORY mydir AS 'c:\myfiles';Note: This does not create the directory on the file system. You have to do that yourself and ensure that oracle has permission to read/write to that file system directory.
    Then, grant permission to the users who require access e.g....
    GRANT READ,WRITE ON DIRECTORY mydir TO myuser;Then use that directory object inside your FOPEN statement e.g.
    fh := UTL_FILE.FOPEN('MYDIR', 'myfile.txt', 'r');Note: You MUST specify the directory object name in quotes and in UPPER case for this to work as it is a string that is referring to a database object name which will have been stored in uppercase by default.
    p.s. as already mentioned by others, this directory must be on your Oracle database server. You can only access client directories if the server itself has a mapping to the client machine itself. Don't expect to provide a path and for the process to access the local client machine of whoever uses it.
    Edited by: BluShadow on 24-Nov-2010 12:24

  • Invalid Directory Structure Error

    So I recently purchased a Panasonic AG-HMC40 and it's my first experience with a non tape camera. When I tried to get the footage onto my computer Final Cut wouldn't recognize it. It worked in iMovie but I would rather not lose quality by transferring it through that first. When I try to open the folder within the log and transfer screen I get an error message that says that it contains unsupported media or "Invalid Directory Structure." I'm on FCP 6.0.5.

    I quite believe it.
    Can you exactly describe what you're doing and how FCE behaves?
    Do you see a preview of the clips after connecting the camera?
    Try to import using iMovie, when this works, it should in FCE somehow, too.
    I googled a bit around and found someone having the same problem (but unfortunately in german language).
    He has formatted the SD card using the camera, then it worked. But the clips beeing on the SD card before are still lost. But if you backup before, you can convert the .mts files into .mov and then import it into FCE.
    Some other possible source of errors:
    - is the HF 100 power cable connected for transfer? (it has to be)
    - did you see the "mode selection" screen when connecting to your Mac?
    - if yes, did you select the "PC mode" there?
    - does the USB port you are using work with other devices?
    - can you try using an SD Card reader instead of the camera?
    - do you see the camera device icon after connecting to your mac?
    - can you try it on another Mac if it works? (if not, it may be a manufacturing issue)
    At moment no more ideas...

  • Compiling Media invalid file path error when buring a DVD

    Hello,
    I have updated to 3.0.2 Premiere Elements and the latest XP Home updates. I had 2.0 and it worked without any problems. I bought 3.0 and have had nothing but problems, I can capture, access files and put a video together but no matter if to file or to DVD I always get this error
    "Burn DVD Progress screen"
    "Compiling Media invalid file path"
    then it all stops and nothing.
    Any help or suggestions appreciated, I searched the web for this error and found nothing, when I search here I seem to get every Adobe product comes up but no premiere.
    Thank you

    I started to do the FAQ to build a clean AVI file. I also re-installed the program, did an update to 3.0.2, defrag. Made sure I had 118gig space. All in order. Still I got the errors. Then I thought perhaps since this pointed to a path that somewhere a path was not correct. So I looked under Preferences - scratch disks - and found they all pointed to the D drive where I had some old Adobe files. It appears the 2.0 version worked when I had the files stored on another partition and 3.0 did not like this. So when I moved everything in Scratch Disk to the same folder on C: where I installed 3.0 things seemed to begin to work.
    I tested it by burning to a file and then to an actual DVD and both worked well. I have a quad core chip.
    Now the problem seems to be when I edit each end of a clip, "the IN and OUT" the in does not seem to be saved or rendered. When I get to the preview I can still see and hear date prior to the SET IN. I save, re-save and re-render and it still happens. However some clips it works fine.
    Thanks again for pointing me in a direction so at least I can start to trouble shoot.

  • Invalid Servlet Path Error on Creation connection to Application Server

    Hi All,
    I have 10.1.2 Application Server installed in unix. I am trying to create application server connection from Windows Jev 10.1.3.3 to my application server. But it Gives Invalid Servlet Path.. Any pointer what the issue could be??
    Regards,
    Praveen

    Hi Praveen,
    Make sure -
    1. Relative path you given is right
    2. Casing is right (name is case sensitive)
    3. Servlet is loaded (read server logs or access through browser)
    May be it can help you out -
    Oc4jDcmServlet problem while creating New App Server Connection
    This is not the right forum for your this question.
    Regards,
    Anuj
    Edited by: Anuj Dwivedi on Jul 2, 2009 5:44 PM

  • Oracle 11g : Directory and UTL_FILE - ORA-29280: invalid directory path

    Hi,
    I have Oracle 11g server on a UNIX box and im accessing it through an Oracle client on a windows box.
    Im new to File operations in Oracle 11g. Have couple of questions;
    1. Can i create a directory in Oracle using CREATE DIRECTORY statment which points to my local machine (windows: on which Oracle client is running).
    for e.g. CREATE OR REPLACE DIRECTORY c_temp AS 'd:\test';
    2. If i can create such a directory, can i use the UTL_FILE.fopen command to open a file from the windows machine and append some text to it.
    Or
    We can only create direcories that are present in the Oracle Server?
    Your help is appreciated.
    Thanks.
    Edited by: user533016 on Feb 1, 2011 3:14 AM

    user533016 wrote:
    Hi,
    I have Oracle 11g server on a UNIX box and im accessing it through an Oracle client on a windows box.
    Im new to File operations in Oracle 11g. Have couple of questions;
    1. Can i create a directory in Oracle using CREATE DIRECTORY statment which points to my local machine (windows: on which Oracle client is running).
    for e.g. CREATE OR REPLACE DIRECTORY c_temp AS 'd:\test';
    2. If i can create such a directory, can i use the UTL_FILE.fopen command to open a file from the windows machine and append some text to it.Though it is not recommended, you could do this with a samba share (I haven't tried it myself yet).
    Or
    We can only create direcories that are present in the Oracle Server?That's what is recommended for various reasons.

  • Issue with UTL FILE, does not read directory path

    Hi Guys
    I have created a procedure using a UTL_File, but when I execute that procedure, it comes with an invalid directory path.
    create directory r_bmw as 'C:\BMW';
    grant read, write on directory r_bmw to bmw;
    The above have been created successfully. (r_bmw is the Directory Name. C:\BMW is the directory path.)
    Below is my code:
    create or replace
    PROCEDURE DCA_BMW_OUT
    IS
    -- Declare all variables as reference
    v_out_file UTL_FILE.FILE_TYPE;
    v_row_Count NUMBER;
    r_bmw NUMBER;
    v_out_directory all_directories.directory_path%type;
    v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
    v_out_buffer varchar2 (32767);
    v_records NUMBER;
    body_output varchar2(32759 BYTE);
    dictionary_guarantorsexist varchar2 (1 Char);
    -- Text required within this part of the procedure
    v_body varchar2(32767 BYTE);
    v_header VARCHAR2(32759 BYTE);
    BEGIN
    --- Directories have been created
    FOR r_bmw IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    -- inner loop produces the rows in each file
    -- outer loop identifies each of the dca's you want to generate a file for
    BEGIN
    -- Output file to be added into the directory specified
    v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- The Header data which will be outputted to the file
    v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
    MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
    |G1Anrede|G1Titel|G1Name|G1Vorname|G1Straße|G1Hausnummer|G1PLZ|G1Ort|G1Land|G1Geburtsdatum|G1Telefonnr.Schuldner|G2Marktpartnernummer|G2Anrede|G2Titel|
    G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
    G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
    G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
    G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
    reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
    RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
    CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
    CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
    CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
    CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
    CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
    CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
    N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
    Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
    N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
    utl_file.PUT_LINE(v_out_file,v_header,TRUE);
    -- Below will output a row of data which satisfy the requirements.
    FOR body_output IN
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.DCAID = 41
    AND Dcaaccountallocation.status = 3
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    LOOP
    UTL_FILE.PUT_LINE (v_out_file,
    body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
    body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
    body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
    body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
    body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
    END LOOP;
    -- UTL_FILE.fclose (v_out_file);
    -- EXCEPTION
    --WHEN OTHERS THEN
    --UTL_FILE.put_line (v_out_file, 'failed');
    -- If any errors occur when closing the file, then we close the opened file.
    IF utl_file.is_open(v_out_file) THEN
              UTL_FILE.put_line (v_out_file, 'failed');
    UTL_FILE.fclose (v_out_file);
    END IF;
    END;
    UPDATE DebtEpisodes
    SET handoverdate = null
    WHERE DCAORLAWYER = 'DCA'
    AND accountid IN
    ( SELECT accountid
    FROM Dcaaccountallocation
    WHERE Dcaaccountallocation.status = 3
    AND Dcaaccountallocation.dcaid = 41
    END LOOP;
    END DCA_BMW_OUT;
    -- It compiles successfully, but when executes, it provides me with the 'invalid directory path' error message.
    Any help?
    Thanks

    Ram wrote:
    DCAID DIRECTORY_NAME MPNO IN_DIRECTORY_NAME INVESTOR
    4     DCA_PKFO_OUT     51950     DCA_PKFO_IN     (null)
    41     INV_ALTOR_OUT     488742     INV_ALTOR_IN Y
    2     DCA_NIG_OUT     686007     DCA_NIG_IN     (null)
    3     DCA_RAF_OUT     777163     DCA_RAF_IN     (null)
    21     INV_INFOSCORE_OUT 3482400     INV_INFOSCORE_IN     Y
    22     INV_HOIST_OUT     2866813     INV_HOIST_IN     Y
    Above is the output when select * from dca additional data.
    I have edited the r_bmw to varchar (32757 BYTE);
    however, the same errors still appear. Would I need to change the select statement to a different table...and not dca additional data?
    ThanksSo you have created a directory name r_bmw
    create directory r_bmw as 'C:\BMW';
    grant read, write on directory r_bmw to bmw;And your are querying select * from dca additional data, which doesn't return your recently created directory.... So... what to do what to do.... You should query the all_directories with directory_name = 'r_bmw'.

  • Invalid File Id Error

    Hello,
    I am using shell script to run a set of sql scripts againts a 9.2 db.
    When the script tries to write a file to a specified location it gives the following error,
    DECLARE
    ERROR at line 1:
    ORA-29282: invalid file ID
    ORA-06512: at "SYS.UTL_FILE", line 714
    ORA-06512: at line 395
    ORA-29280: invalid directory path
    But if I run the same set of queries in a different box it runs successfully with now issues. We have verified that both versions of Oracle and AIX are one and the same. the directories to which it is trying to write has the same permissions too. Also did a comparison of the objects and didn't see any difference.
    Any help in this regard would be greatly appreciated.
    Thanks,
    Jubil

    set serveroutput on size 10000
    define_editor=vi
    define home_directory = '/scripts/db/loadstage/';
    DECLARE
    -- Declare Variables
    v_err_msg varchar(4000) := '';
    output_file UTL_FILE.FILE_TYPE;
    output_dir VARCHAR(255) := '&home_directory';
    output_log_file VARCHAR(50) := 'data-FKCONFLICT.' || to_char(sysdate,'MM') || '.' || to_char(sysdate,'DD') || '.' ||
                             to_char(sysdate,'YY') || '.log';
    v_table varchar(30);
    --Open directory file to write log   
    output_file := UTL_FILE.FOPEN(output_dir, output_log_file, 'w');
    UTL_FILE.PUT_LINE(output_file,'PRODUCT-TRADE REFERENCE:');
    v_table := 'TEMP_PRODUCT';     
    FOR r_fk_delete_prod_trade IN c_fk_delete_prod_trade LOOP
         --Delete Records from Staging Table into Production Table
              UTL_FILE.PUT_LINE(output_file,'Deleting from '|| v_table || ': ' ||
         r_fk_delete_prod_trade.res_trade_id);
         DELETE temp_product
         WHERE res_trade_id = r_fk_delete_prod_trade.res_trade_id or
              (res_trade_id is null and r_fk_delete_prod_trade.res_trade_id is null );
    DBMS_OUTPUT.PUT_LINE(r_fk_delete_prod_trade.res_trade_id);     
         UTL_FILE.PUT_LINE(output_file,'Deleted from '|| v_table || ': ' ||
         r_fk_delete_prod_trade.res_trade_id);
    IF SQL%NOTFOUND THEN
              RAISE_APPLICATION_ERROR(-20001, 'Error Deleting FK Conflict to: '|| v_table, TRUE);
         END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN ROLLBACK;
         v_err_msg := SQLCODE || ': ' || SQLERRM;
         UTL_FILE.PUT_LINE(output_file,to_char(sysdate, 'MM/DD/YY@HH:MI:SS') || ' - ' || v_err_msg);
    END;
    EXIT

  • Create directory utl_file errors

    I thought that I would be able to answer my problem with all the help I've seen online. I don't seem to be able to.
    I have the following code (snippet) below from my procedure:
    v_file varchar2(100);
    v_direc constant varchar2(30) := 'c:\output\';
    v_testfile UTL_FILE.FILE_TYPE;
    BEGIN
    v_testfile := utl_file.fopen('C:\output', 'JohnsUIICounts.txt', 'w');
    open csr_uii;
    loop
    fetch csr_uii into csr_uii_a, csr_uii_b, csr_uii_c, csr_uii_d;
    exit when csr_uii%NOTFOUND;
    utl_file.put_line(v_testfile, csr_uii_a || ' ' || csr_uii_b || ' '|| csr_uii_c || ' '|| csr_uii_d);
    end loop;
    I logged on to SQL Developer and did:
    CREATE DIRECTORY V_DIREC AS 'C:\output\';
    GRANT WRITE ON DIRECTORY V_DIREC TO PUBLIC;
    I got the message back that the directory was created. When I go to the c:\ drive, I don't see the directory.
    Any ideas? I've gone through all sorts of iterations like changing the drive from c to e, different folder names, upper and lower case, nothing works.
    Victoria

    Thanks. Now that I understand that, I created the directory on the server. I reran the code. I'm still getting:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    I notice that on the Windows Server, when I create the directory (as an admin user), I check on the properties, and it keeps staying read only. I can modify it, but the change doesn't save. I heard something about group permissions. Is it possible that the problem is because of permissions on the server? I would think that might be the real problem at this point.
    Thanks,
    Victoria
    Edited by: user3804901 on May 20, 2009 4:31 AM

Maybe you are looking for

  • How to change the font size and style on run time

    dear all i try to change the font style and font size on runtime. I did the following: 1- i created an item(:font_size) in which i will write the size of the font for the the other item ('customer_name') 2 on the post_change trigger for 'font_size' i

  • IPhone sync on iTunes 9 and iTunes 10

    I sync my iPhone on different computers for different data FOR Music, Software Updates, Apps I use Mac Mini w/10.5.X running latest iTunes 10 Works fine. FOR Data, Address book and Photos I use MacBook Pro w/10.4.x running latest iTunes 9 now iTunes

  • My iPhone is in recovery mode, how do I get out it?

    My iPhone is stuck in recovery mode and I have tried everything. What do I do?

  • Recreation of Info-Views as Business Views

    Hello, We have been running reports on Crystal 7 (Seagate Info 7) and have installed BOXI R2 and managed to migrate the reports to Crystal XI.  Just not sure if we have done this in the most effective way and if issues can arise from how we have set

  • Rounding of decimal values into XML using DOM

    I want to roundoff 10.456 to 10.4(while generating the xml) using DOM. Please let me know how to handle this? Thanks in advance