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!

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

  • 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');

  • 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.

  • 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

  • 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

  • Application Giving Error--"Invalid Home/Path requested"

    Hi ,
    I have an application on BEA Weblogic 8.1.When I deployed it on local server it is working finebut when i tried it to build EAR and deployed it on server I am getting an invalid home/path requested erroe.I am setting all context path correctly.
    Any idea...???
    Thanks in advance...
    Darshan

    ... -d C:\Program" Files\Xinox "Software\JCreatorV3LE\MyProjects\zeroCode\classes ...
    Looks like you are typing in things wrong with the double quotes.

  • 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.

  • 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

  • Reg UTL_FILE error

    hi all,
    iam using utl_file in my procedure.while executing the script its showing error as
    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 line 1
    ORA-06512: at "DBUSER.INPUT_AS", line 60
    ORA-06512: at line 1
    but i have created directory as output and granted permission to the user also.
    but still its showing error .can anybody pls help me out...
    thanks in advance,
    Ratheesh

    Have you assigned that value in the parameter file of
    your database. If not this will give you error.
    In your parameter file UTL_FILE_DIRECTORY should be
    set to that directory path or as * .
    I have to keep saying this, but NO IT SHOULD NOT!!!!
    UTL_FILE_DIR parameter is the "old" way of doing things and leaves your operating system open to security issues. You should not use this parameter and more importantly, you should NEVER set that parameter to "*" otherwise someone may gain access to your whole operating system.
    The correct way of using UTL_FILE is to create Directory Objects on the database and grant the relevant permissions to the users who require access.

  • 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'.

  • Utl_file errors

    create or replace procedure load_student
    (pdir varchar2, pfile varchar2) is
    vfile utl_file.file_type;
    vtext varchar2(200);
    vname varchar2(20);
    vcourse varchar2(20);
    vfee number(5);
    fcomma number(3);
    scomma number(3);
    begin
    vfile := utl_file.fopen(pdir,pfile,'r');
    Loop
    BEGIN
    utl_file.get_line(vfile,vtext);
    EXCEPTION
    when no_data_found then
    exit;
    END;
    fcomma := instr(vtext,',',1,1); -- 5
    scomma := instr(vtext,',',1,2); -- 14
    vname := substr(vtext,1,fcomma-1);
    vcourse := substr(vtext,fcomma+1,scomma-fcomma-1);
    vfee := substr(vtext,scomma+1);
    insert into student values(student_sq.nextval,vname,vcourse,vfee);
    end loop;
    commit;
    exception
    when utl_file.read_error then
    dbms_output.put_line(' Unable to read the file...... ');
    end load_student;
    when i am executing i get following error
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    ORA-06512: at "SYS.LOAD_STUDENT", line 11
    ORA-06512: at line 3
    View program sources of error stack?
    please help me when you know the answer,immidiatly

    Can you show the directory path. I think issue is there only. Anyways, i would repeat my prev replies for your help.
    If your file is located on the client system, you dnt have to give ip address and exact path. You have to give machine name along with shared address. Suppose the file a.txt is located in C:\Files\. And you have put this folder on shared.
    Grant R/W access to the server for the folder.
    Create directory MYDIR as '\\Client_Name\Files\'Now Grant access priveleges to the user using UTL_FILE utility.
    For server file location, you can specify the exact path in the directory path.
    Hope my points helps you out.

  • Error at directory..

    hi
    i have created directory like
    create or replace directory emp_dir as 'c:test.txt';
    directory was successed
    then
    create a procedure like this
    CREATE OR REPLACE PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('C:\hello.txt','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;
    i compiled it.
    and i executed procedure..
    i am getting error like this..
    ERROR -29280ORA-29280: invalid directory path
    please help out here

    create or replace directory emp_dir as 'c:\';
    CREATE OR REPLACE PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('emp_dir','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);
    END;

Maybe you are looking for

  • Report giving a error in background job

    Hi all , I am facing a major issue , I have a normal executable report which when i run in foreground works fine , but when i go to option in menu bar and choose the option to run the report in background it , i choose to start the job immediate , th

  • Use Events or delegates in my application??

    I am trying to implements events in c#. my scenario is that there will be multiple events and there will be multiple events listeners to an event(many to many relationship). the problem here is since there are many events and if i implement all in on

  • Xp ethernet driver

    Right I am new to Mac's and this forum so hello everyone. My problem is with bootcamp and ive only found one forum entry on the net that points to this isuue so i hope you lot can help me. I've got Mac OS X 10.6.7 and have decided i also need xp on a

  • TS1363 my computer is not recognizing my iphone 5

    I got a new computer and it was all working now my Iphone 5 wont recognise

  • APPS account usage tracking

    A requirement from client: Track all the developers who are using apps account to login to EBS database(ex, sqlplus apps/****@TEST, or using any tool like, Toad, Sql Developer etc.). We find from v$session we can retrieve the required information, bu