Still has ORA-20100 Invalid File Path

I did
SQL> CREATE DIRECTORY sqllog as 'c:\sqllog';
SQL> grant write on directory sqllog to public;
Then on c:\sqllog
i have a file called sqllog.txt
but still gives the same error

Here is your answer. You have to set your initialization parameter 'UTL_FILE_DIR' to 'C:\SQLLOG\'. You have to bounce the database to do that. You cannot use an 'alter system' command.
Drop and recreate your directory.
For example,
CREATE DIRECTORY log_dir AS 'C:\SQLLOG\'.
/* I am really vary about this privilege. You are better off limiting the privilege to a select few.*/
GRANT READ, WRITE ON DIRECTORY log_dir TO PUBLIC;
Make the first parameter to the procedure 'UTIL_FILE.FOPEN' to be 'C:\SQLLOG\'.
It should work and add the word 'NICK' to the file.

Similar Messages

  • ORA-29283 invalid file operation

    NLSRTL      10.2.0.5.0     Production
    Oracle Database 10g Enterprise Edition      10.2.0.5.0     64bi
    PL/SQL      10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000:      10.2.0.5.0     Productio
    I am trying to get the content of a trace file generated for me.
    Because I don't have privileges to log on the server and copy the trace file for me directly with some os user, I am doing the following:
    1. I alter my session trace identifier to easier identify the trace file
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'Func01';2. I invoke DBMS_MONITOR
    3. I run the procedure I want to monitor.
    4. I disable the monitoring by calling DBMS_MONITOR
    5. At this point I run the following query to identify my trace file:
    select u_dump.value || '/' || instance.value || '_ora_' || v$process.spid || nvl2(v$process.traceid, '_' || v$process.traceid, null ) || '.trc'"Trace File"
    from V$PARAMETER u_dump
    cross join V$PARAMETER instance
    cross join V$PROCESS
    join V$SESSION on v$process.addr = V$SESSION.paddr
    where 1=1
       and u_dump.name = 'user_dump_dest'
       and instance.name = 'instance_name'
       and V$SESSION.audsid=sys_context('userenv','sessionid');It gives me: /ORACLE/MYDB/trace/MYDB_ora_3616822_Func01.trc
    I have created directory in advanced on the path where the traces are stored:
    CREATE OR REPLACE DIRECTORY trace_dir AS '/ORACLE/MYDB/trace/';
    SELECT * FROM dba_directories WHERE directory_name = 'TRACE_DIR';
    Output:
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS     TRACE_DIR      /ORACLE/MYDB/trace/I don't have rights to grant read, write on TRACE_DIR to my user, as I am not logged with SYS.
    I created a table to store in it the lines from the trace file:
    CREATE TABLE tmp_traces_tab
      callnum NUMBER,
      line NUMBER,
      fileline CLOB
    );Then I run the following PL/SQL block to retrieve the content of the trace and store it in the table T:
    DECLARE
      l_file            UTL_FILE.file_type;
      l_location     VARCHAR2 (100) := 'TRACE_DIR';
      l_filename    VARCHAR2 (255) := 'MYDB_ora_3616822_Func01.trc';
      l_text           VARCHAR2 (32767);
      l_line           NUMBER := 1;
      l_call           NUMBER := 1;
    BEGIN
      -- Open file.
      l_file := UTL_FILE.fopen (l_location, l_filename, 'r', 32767);
      -- Read and output first line.
      UTL_FILE.get_line (l_file, l_text, 32767);
      INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
      l_line := l_line + 1;
      BEGIN
        LOOP
          UTL_FILE.get_line (l_file, l_text, 32767);
           INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
           l_line := l_line + 1;
        END LOOP;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          NULL;
      END;
      INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
      l_line := l_line + 1;
      UTL_FILE.fclose (l_file);
    END;
    /And when I run the code I get the error: ORA-29283 invalid file operation.
    Is it possible to a role my user to be able to get the content of the trace files in the directory TRACE_DIR without having explicit READ , WRITE privileges on it?
    My user currently has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U1     OPR_ROLE_LOSS_SNAPSHOT_READER     YES     YES
    U1     RESOURCE     NO     YES
    U1     CONNECT     NO     YES
    U1     DBA     NO     YES
    U1     OPR_ROLE_SUPPORT_USER     YES     YESI know that on another db with different user I hit no errors when doing completely the same (of course the program unit I monitor is different).
    That other user with which I have NO issues has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U2    DBA    NO    YES
    U2    EXEC_SYS_PACKAGES_ROLE    NO    YES
    U2    EXECUTE_CATALOG_ROLE    NO    YES
    U2    CONNECT    NO    YES

    Verdi wrote:
    NLSRTL      10.2.0.5.0     Production
    Oracle Database 10g Enterprise Edition      10.2.0.5.0     64bi
    PL/SQL      10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000:      10.2.0.5.0     Productio
    And when I run the code I get the error: ORA-29283 invalid file operation.
    Is it possible to a role my user to be able to get the content of the trace files in the directory TRACE_DIR without having explicit READ , WRITE privileges on it?
    My user currently has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U1     OPR_ROLE_LOSS_SNAPSHOT_READER     YES     YES
    U1     RESOURCE     NO     YES
    U1     CONNECT     NO     YES
    U1     DBA     NO     YES
    U1     OPR_ROLE_SUPPORT_USER     YES     YESI know that on another db with different user I hit no errors when doing completely the same (of course the program unit I monitor is different).
    Thanks for posting version alongwith other details.
    TO my knowledge, No you cannot.
    Privileges acquired via a Role are not valid in PL/SQL. You need to have explicit privileges.

  • 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 file path when building

    Okay so I try to build a DVD folder and once it gets to the "opening project" part I get an error message that says "invalid file path". I'm going to try and burn it later once I get a chance, just wondering if anyone has any insights before I try.
    Any help would be great, thanks.

    Ben,
    Glad to say (for me), that I have not seen these two errors. Doesn't help you, but I do have one thought. "Invalid File Path," indicates that Encore could not find the path specified. In searching for a solution to that error, I'd check to see if the path, that you designated, exists, exists in the exact spelling that you specify, and that it is available - not on an external that is powered down, not on a network, etc.. Check your spelling religiously. Check your "\'s" your "/'s" and everything about the path. Check in Explorer that the two match, and that that path is available. Put it on an internal HDD and make sure that it is not open in any other program. As a test, Copy a file to it. Open that file. If all goes well, then Delete that test file, before you Export to that folder.
    It's probably a matter of dotting the "i's" and crossing the "t's."
    Hunt

  • Internet Explorer Unsupported video type or invalid file path? HTML 5

    Hello.
    First I would like to salute all you people out there that answer questions in these forums. Thank you! They have been more helpful than my Web Design class.
    Here is my problem. I cannot get Internet Explorer to play my video files. It says Unsupported video type or invalid file path. I have added the .htaccess file for MIME types, and included .mp4, .ogg, and .webm. I have also included a smaller resolution for mobile. Any help or pointers would be appreciated.
    Also if anybody could explain to me in an idiot proof way how to add flash support step by step for this site that would be great. I have searched all over the internet, read many tutorials, used the free code makers, and I still cannot get flash to work.
    This is my first website, please go easy on me!
    Site address is www.mindtrickvp.com 
    Thanks everybody

    This is not proper HTML syntax:  Divs must be inside the <body> tag.
    </head>
    <div id="contactdiv"><a href="Contact.html"><img src="Images/CONTACTWEB.png" alt="" width="300" height="50" id="contact"/></a></div>
    <div id="logodiv"><a href="index.html"><img src="Images/LOGO550x210retry.png" alt="" width="550" height="210" id="logo"/></a></div>
    <div id="MOTIONGRAPHICSTEXT"><a href="Motion Graphics.html"><img src="Images/MOTION-GRAPHICS.png" width="410" height="50" alt=""/></a></div>
    <div id="COMMERCIALSTEXT"><img src="Images/COMMERCIALS.png" width="410" height="45" alt=""/></div>
    <div id="WEDDINGTEXT"><img src="Images/WEDDINGS.png" alt="" width="300" height="45"/></div>
    <body>
    =====================
    Replace what you have with this:
    </head>
    <body>
    <div id="contactdiv"><a href="Contact.html"><img src="Images/CONTACTWEB.png" alt="" width="300" height="50" id="contact"/></a></div>
    <div id="logodiv"><a href="index.html"><img src="Images/LOGO550x210retry.png" alt="" width="550" height="210" id="logo"/></a></div>
    <div id="MOTIONGRAPHICSTEXT"><a href="Motion Graphics.html"><img src="Images/MOTION-GRAPHICS.png" width="410" height="50" alt=""/></a></div>
    <div id="COMMERCIALSTEXT"><img src="Images/COMMERCIALS.png" width="410" height="45" alt=""/></div>
    <div id="WEDDINGTEXT"><img src="Images/WEDDINGS.png" alt="" width="300" height="45"/></div>
    <p id="WELCOMETO"> Welcome to MindTrick Video Productions</p>
    <p id="WEOFFER">
    We offer high quality video production including but not limited to<BR> Commercial, Training, Wedding, Documentary, and How-To videos.<BR> We also do motion graphics.<BR> We would love for you to be our next client! <BR>Contact us now for further information.</p>
    <a href="mailto:[email protected]" id="EMAIL">[email protected]</a>
    <a href="tel:+16158012005" id="PHONE">(615) 801-2005</a>
    </body>
    </html>
    Nancy O.

  • CREATE_CASH : ORA-29282: invalid file ID

    While running the AR_RECEIPT_API_PUB.create_and_apply to create and apply a receipt in R12, i get the error:
    Message 1. CREATE_CASH : ORA-29282: invalid file ID
    Message 2. ORA-29282: invalid file ID in Package AR_RECEIPT_API_PUB Procedure Create_cash
    DECLARE
    l_return_status VARCHAR2(1);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(240);
    l_cash_receipt_id NUMBER;
    p_count number := 0;
    BEGIN
    -- 1) Set the applications context
    mo_global.init('AR');
    mo_global.set_policy_context('S','83');
    fnd_global.apps_initialize(1303, 50695, 222,0);
    AR_RECEIPT_API_PUB.create_and_apply
    ( p_api_version => 1.0,
    p_init_msg_list => FND_API.G_TRUE,
    p_commit => FND_API.G_TRUE,
    p_validation_level => FND_API.G_VALID_LEVEL_FULL,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data,
    p_amount => 1309.6,
    p_receipt_number => 'TIENDA-api2',
    p_receipt_date => '22-JUL-2012',
    p_gl_date => '22-JUL-2012',
    p_customer_number => 1007,
    p_receipt_method_id => 1000,
    p_trx_number => '145996',
    p_cr_id => l_cash_receipt_id );
    -- 3) Review the API output
    dbms_output.put_line('Status ' || l_return_status);
    dbms_output.put_line('Message count ' || l_msg_count);
    dbms_output.put_line('Cash Receipt ID ' || l_cash_receipt_id );
    if l_msg_count = 1 Then
    dbms_output.put_line('l_msg_data '|| l_msg_data);
    elsif l_msg_count > 1 Then
    loop
    p_count := p_count + 1;
    l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
    if l_msg_data is NULL Then
    exit;
    end if;
    dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
    end loop;
    end if;
    END;

    Please see these docs.
    Oracle Receivables Reference Guide Release 12 [ID 1077107.1]
    Oracle Receivables: Receipts API Known Issues and Patches [ID 1362066.1]
    Oracle Receivables: Receipts API Overview, Setup, Sample Scripts and Troubleshooting [ID 1361075.1]
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=AR_RECEIPT_API_PUB&c_owner=APPS&c_type=PACKAGE
    https://forums.oracle.com/forums/search.jspa?threadID=&q=AR_RECEIPT_API_PUB.create_and_apply&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Invalid file path

    After upgrading to encore 2 i uninstalled 1.5 and now there is one project I cant open. Every time I get the error message "invalid file path" and then an exit to the Encore startup menu.
    I can see the Encore projet folders with all the files in and nothing seems altered.
    Any suggestions?
    -Jesper

    Great!
    >BTW, 2.0 & 1.5 can coexist happily on your system.
    Just to further clarify that statement, note that although this statement is true, Encore 2.0 projects can't be opened in Encore 1.5. Other than that, happy coexistence. :)

  • Invalid File Path Names in Mac OS X

    Hello,
    I am trying to create a Javascript in Mac OS X 10.4.11, however I am having some trouble with what characters are valid in file path names in Mac OS X. Does anybody know where I can get a list of invalid characters that cannot be used in a file name?
    Thanks,
    james

    Any character other than a colon can be used in the name, but additional characters and names may be handled differently if you are interacting with the UNIX shell in the script.
    (30221)

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

  • ORA-31001:Invalid resource handle or path name"/apps/batchadm/files/test.xm

    Hi,
    When i am trying to parse the xml document using XDB API. I passed the XML file path to the parse function and making use of that at below lines of code.
    xmlparser.setBaseDir(prsr, dir);
    xmlparser.parse (prsr, dir || '/' || file_in);
    In thsi sceneraio it is giving the below error saying invalid path. But i am giving the right path. And even the file having all permission( 777).
    Can any please help me why i am getting this error even if i mentioned the correct path? Is there anything related the permission grants?
    ORA-31001: Invalid resource handle or path name "/apps/batchadm/files/test.xml"
    ORA-06512: at "SYS.XDBURITYPE", line 11
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 142
    ORA-29280: invalid directory path
    ORA-29280: invalid directory path
    ORA-29280: invalid directory path
    ORA-06512: at "XDB.DBMS_XMLPARSER", line 119
    ORA-06512: at "SIGCAP.PARSE_DOCUMENT", line 11
    Thanks,
    shashi

    Could be privs on OS or database level. Check and see what happens if grant yourself the DBA role. Check if the database software owner (ps -ef | grep pmon) is allowed to write in that directory and/or create a file in that directory. Does the OS make use of ACL's (and/or is, for instance Secure, Linux used)....?

  • ORA-31001: Invalid resource handle or path name

    I am using Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production.
    I need to read xml contents from a file at D:\ on my windows system.
    File name is test.xml.
    I am using the system account as its a personal server.
    I tried as follows:
    SQL> CREATE DIRECTORY myxml AS 'D:';
    SQL> declare
    2 parser xmlparser.Parser;
    3 begin
    4 xmlparser.parse(parser,'myxml\test.xml');
    5 end;
    6 /
    declare
    ERROR at line 1:
    ORA-31001: Invalid resource handle or path name "myxml\test.xml"
    ORA-06512: at "SYS.XDBURITYPE", line 11
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 142
    ORA-29280: invalid directory path
    ORA-29280: invalid directory path
    ORA-29280: invalid directory path
    ORA-06512: at "XDB.DBMS_XMLPARSER", line 120
    ORA-06512: at line 4
    D: is a FAT32 partition so Windows 7 offers no acl/permission restrictions. I have also tried from other different locations and the error is the same.
    Please help me.

    907985 wrote:
    SQL> CREATE DIRECTORY myxml AS 'D:';
    ORA-29280: invalid directory path
    ORA-06512: at "XDB.DBMS_XMLPARSER", line 120I haven't tried it, but perhaps it's as simple as error message implies. Try with at least one directory e.g. D:\ or D:\somefoldername in the directory object's path name.

  • 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

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

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

Maybe you are looking for

  • Why can't I login into my Apple account without being forced to change my password.

    I received an email from Apple: "The following changes to your Apple ID (xxxxxxxxxxxx) were made on 01 January 2015 at 17:52:54 (GMT): Shipping and/or billing address. When I log on to check my Shipping and Billing address I am prompted to change my

  • I get error code 4850(0x000012f2) after burning mp3. Can someone help me?

    MicrosoftWindows Vista Home Premium Edition Service Pack 2 (Build 6002) eMachines, inc.eMG720 iTunes10.4.0.80 QuickTime 7.6.9 FairPlay1.12.20 AppleApplication Support 1.5.2 iPod UpdaterLibrary 10.0d2 CD Driver2.2.0.1 CD Driver DLL2.1.1.1 Apple Mobile

  • IMEI code

    Hello! Could anybody help me!  Is it possible to find IMEI code of iphone 5. My phone was stolen and the box was disposed. The question is: is it possible to find IMEI code using only icloud account (find my iPhone service)...or some other options. Y

  • Arabic language is printing in reverse when I am printing

    Hi, I have developed a form in english and I have written the company name in Arabic language.  This Arabic language is printing in reverse when I am veiwing the print preview and as well as printing it. Anybody please tell me how to solve this. Rega

  • Rated drag and drop

    Hello everyone. I apologise for asking a question that has probably been answered previously. I have a dilemma with my animation that I have tried prowling the Internet for for quite some time now and I have yet to find a solution to fit what it is I