Invalid_path exception while using UTL_FILE.FOPEN

Hi
I am getting invalid_path exception while using the UTL_FILE.fopen subprogram. I tried finding out the reason but could not solve it. Please help.
Below is my piece of code.
create directory utldr as 'e:\utldir';
declare
f utl_file.file_type;
s varchar2(200);
begin
dbms_output.put_line('1');
f := utl_file.fopen('UTLDR','utlfil.txt','r');
dbms_output.put_line('2');
utl_file.get_line(f,s);
dbms_output.put_line('3');
utl_file.fclose(f);
dbms_output.put_line('4');
dbms_output.put_line(s);
exception
when utl_file.invalid_path then
dbms_output.put_line('invalid_path');
end;
the result is:
1
invalid_path

I am executing it from sys. The same user who created the directory.
The output is as below:
SELECT * FROM dba_directories
OWNER     DIRECTORY_NAME     DIRECTORY_PATH
SYS     MEDIA_DIR      d:\avale\rel4\demo\schema\product_media\
SYS     LOG_FILE_DIR     d:\avale\rel4\assistants\dbca\logs\
SYS     DATA_FILE_DIR     d:\avale\rel4\demo\schema\sales_history\
SYS     EMP_DIR     E:\Oracle Directory
SYS     REMOTED     \\10.1.1.12\oracle directory
SYS     UTLDR     e:\utldir
SELECT * FROM dba_tab_privs WHERE table_name='UTLDR'
GRANTEE     OWNER     TABLE_NAME     GRANTOR     PRIVILEGE     GRANTABLE     HIERARCHY
PUBLIC     SYS     UTLDR     SYS     READ     NO     NO

Similar Messages

  • Broken korean characters while using utl_file.fopen

    Hi,
    I have korean data in a table and I need to extract it out.
    Am using utl_file.fopen for this. It extracts, but korean characters are coming broken...
    Is there some setting (NLS_LANG etc) that I need to do? I tried NLS_LANG korean_korea.KO16KSC5601 but didn't help...
    Thanks,
    Sachin

    Please post this question in the Database forum for an appropriate response: General Database Discussions
    Regards,
    OTN

  • Error while using UTL_FILE.FOPEN

    sir,
    when i write procedure using utl_file.fopen i am getting error as it must be declared PLS-00201. what mistake, i am doing.
    yours
    dr.s.r.bhattachar

    i was under the impression that there will be a moderator who will redirect the question even by mistake we post? is it not?Absolutely not. On the APEX forum we are in the fortunate position of having members of Oracle's APEX team actively involved, but neither they nor any of the other contributors perform the role of moderator or have administrative access to the forum system. The OTN team who do only really perform "moderation" when there has been a breach of the OTN Terms and Conditions.
    If your question has obviously been posted in the wrong forum, or someone thinks you will get a better response elsewhere then generally they'll suggest this, as above.

  • Error while using UTL_FILE

    I am getting the following error while using UTL_FILE procedure while using UTL_FILE.FOPEN procedure
    from system account. I am using Windows XP with NTFS.
    SQL> create or replace directory FILE_DIR as 'C:\'
    2 /
    Directory created.
    SQL> grant read on directory FILE_DIR to public;
    Grant succeeded.
    1 create or replace PROCEDURE file_upload IS
    2 v_file_name VARCHAR2(200);
    3 v_file_type UTL_FILE.FILE_TYPE;
    4 v_line VARCHAR2(1000);
    5 BEGIN
    6 v_file_name := 'customers_'||TO_CHAR(SYSDATE,'dd')||TO_CHAR(SYSDATE,'MON')||TO_CHAR(SYSDATE,'YYYY')||'.txt';
    7 v_file_type := UTL_FILE.FOPEN('FILE_DIR','V_FILE_NAME','r',1000);
    8 UTL_FILE.GET_LINE(v_file_type,V_LINE,1000);
    9 UTL_FILE.FCLOSE(v_file_type);
    10 DBMS_OUTPUT.PUT_LINE(V_LINE);
    11* END;
    SQL> exec file_upload;
    BEGIN file_upload; END;
    ERROR at line 1:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 475
    ORA-29283: invalid file operation
    ORA-06512: at "SYSTEM.FILE_UPLOAD", line 7
    ORA-06512: at line 1
    I appreciate if someone can help me in this regard.
    Thanks in Advance.
    Regards
    Muhammad ALi

    Hello,
    What exactly are you trying to do? Here I got 2 examples for you , replace with your directory name and pick right option for 'a' (append) or 'w' (write) or 'R' (read).
    To read from a directory_ . This will read an existing file 'customer.txt" from the directory
    {code}
    CREATE OR REPLACE PROCEDURE .file_upload
    IS
    v_file_name VARCHAR2 (200);
    v_file_type UTL_FILE.file_type;
    v_line VARCHAR2 (1000);
    BEGIN
    v_file_name := 'customers.txt';
    v_file_type := UTL_FILE.fopen ('EXT_TABLES', v_file_name, 'R');
    UTL_FILE.get_line (v_file_type, v_line); -- Error was here
    DBMS_OUTPUT.put_line (v_line);
    UTL_FILE.fclose (v_file_type);
    END;
    {code}
    _*To open a file*_ This will create customer_XXXXX file under the directory
    {code}
    CREATE OR REPLACE PROCEDURE testme.file_upload
    IS
    v_file_name VARCHAR2 (200);
    v_file_type UTL_FILE.file_type;
    v_line VARCHAR2 (1000);
    BEGIN
    v_file_name := 'customers_'
    || TO_CHAR (SYSDATE, 'dd')
    || TO_CHAR (SYSDATE, 'MON')
    || TO_CHAR (SYSDATE, 'YYYY')
    || '.txt';
    v_file_type := UTL_FILE.fopen ('EXT_TABLES', v_file_name, 'a');
    UTL_FILE.put_line (v_file_type, v_line);
    DBMS_OUTPUT.put_line (v_line);
    UTL_FILE.fclose (v_file_type);
    END;
    {code}
    Regards
    Edited by: OrionNet on Jan 29, 2009 12:30 AM

  • Exception while using unit of work commit

    Hi,
    I have using this code to create a object
    KbAdAlerts alert = new KbAdAlerts();
    alert.setAlertId(kmData.getAlertId());
    alert.setAlertDesc(kmData.getOutcome());
    alert.setAlertLastRevisionDate(KmUtils.convertReviewDate(kmData.getReviewDate()));
    alert.setAlertType(kmData.getAlertType());
    System.out.println("Alert Object :" + alert);
    KbAdAlerts alertClone = (KbAdAlerts) uow.registerObject(alert);
    System.out.println("Clone Alert:" + alertClone);
    uow.printRegisteredObjects();
    uow.commit();
    I am getting exception while using uow.commit(). I have gone into alert object and everything seems to be fine.
    Could you help me in this issue.
    Thanks,
    Ashish
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("AD_OWNER"."KB_AD_ALERTS"."ALERT_ID")
    Error Code: 1400
    Call:insert into kb_ad_alerts(alert_id, alert_desc, alert_type, alert_last_revision_date)
    values
    (NULL, NULL, NULL, NULL)
    Query:InsertObjectQuery(oracle.ccr.admin.model.KbAdAlerts@6108)
         at oracle.toplink.exceptions.TopLinkException.<init>(TopLinkException.java:46)
         at oracle.toplink.exceptions.DatabaseException.<init>(DatabaseException.java:50)
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:282)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:658)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:707)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:496)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:442)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(UnitOfWork.java:1603)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:103)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:238)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObject(DatabaseQueryMechanism.java:355)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:433)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:60)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(DatabaseQueryMechanism.java:622)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(DatabaseQueryMechanism.java:586)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:479)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommitWithChangeSet(WriteObjectQuery.java:110)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:259)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:603)
         at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:519)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:100)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:72)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2532)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:981)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:938)
         at oracle.toplink.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:240)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:161)
         at oracle.toplink.publicinterface.Session.writeAllObjectsWithChangeSet(Session.java:3123)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(UnitOfWork.java:1242)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1330)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(UnitOfWork.java:1097)
         at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:865)
         at oracle.ccr.admin.model.FeedbackServices.writeFeedback(FeedbackServices.java:116)
         at oracle.ccr.admin.view.AlertDetails.updateTables(AlertDetails.java:834)
         at oracle.ccr.admin.view.AlertDetails.commandButton1_action(AlertDetails.java:822)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
         at oracle.adf.view.faces.component.UIXCollection.broadcast(UIXCollection.java:94)
         at oracle.adf.view.faces.component.UIXTable.broadcast(UIXTable.java:205)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:629)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Hi,
    I am having a similar problem that results in this stack trace. The funny thing is that it occurs after a session.logout/login and re-read of the object I'm trying to update. The other thing is that if I remove objects from the transaction it just happens somewhere else - on a different object/descriptor. I am attempting to upgrade from 9.03 runtime to the 10.0.3.1 builder/runtime. I am connecting to a Sybase 12.5 db.
    Any ideas on this one?
    Thanks,
    Bret
    This is the sql that is found in the DatasourceCallQueryMechanism. We are not using any custom SQL.
    SQLCall(INSERT INTO Invoice (id, description, billingAddress, customerNote, invoiceNumber, startDate, stopDate, sentDate, commitDate, customerId, dueDate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))
    java.lang.NullPointerException
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:213)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:156)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:170)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:426)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:65)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:75)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:251)
         at oracle.toplink.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:47)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:542)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:100)
         at oracle.toplink.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:72)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2578)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:945)
         at oracle.toplink.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:243)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjectsForClassWithChangeSet(CommitManager.java:218)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:174)
         at oracle.toplink.publicinterface.Session.writeAllObjectsWithChangeSet(Session.java:3177)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(UnitOfWork.java:1282)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1370)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(UnitOfWork.java:1137)
         at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:905)
         at com.tbs.database.DBBroker.mergeSingleObject(DBBroker.java:288)
         at com.tbs.database.DBBroker.merge(DBBroker.java:235)
         at com.tbs.database.DBBrokerSetInvoker.merge(DBBrokerSetInvoker.java:73)
         at com.tbs.database.TbsDataSource.merge(TbsDataSource.java:353)
    /////////////////////////////////

  • Error while using UTL_FILE package

    I am getting error while using UTL_FILE package in apex 3.0 version
    Pls help me out.

    ok, how are you using UTL_FILE and what is the error?

  • PL/SQL package using utl_file.fopen gets invalid_path error

    The init.ora file has utl_file_dir = * in it. When writing a package trying to utilize the utl_file.fopen the invalid_path error always occurs. What is the fix to resolve the path error?

    create or replace package body TEST_UTL_FILE is
    -- Purpose : Sample package that uses UTL_FILE procedure(s)
    -- ===========================================================================================================
    -- Process Request
    -- ===========================================================================================================
    procedure Process_Request is
    -- Local Variable(s)
    v_file_id sys.UTL_FILE.FILE_TYPE;
    v_buffer varchar2(32767);
    begin
    v_file_id := sys.utl_file.FOPEN('D:\Oracle\XMLFiles',
    'Sample1.xml',
    'R');
    sys.utl_file.GET_LINE(v_file_id, v_buffer);
    return;
    exception
    -- Error number -29280
    WHEN UTL_FILE.INVALID_PATH THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_path');
    -- Error number -29281
    WHEN UTL_FILE.INVALID_MODE THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_mode');
    -- Error number -29282
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_filehandle');
    -- Error number -29283
    WHEN UTL_FILE.INVALID_OPERATION THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_operation');
    -- Error number -29284
    WHEN UTL_FILE.READ_ERROR THEN
    RAISE_APPLICATION_ERROR(-20001, 'read_error');
    -- Error number -29285
    WHEN UTL_FILE.WRITE_ERROR THEN
    RAISE_APPLICATION_ERROR(-20001, 'write_error');
    -- Error number -29286
    WHEN UTL_FILE.INTERNAL_ERROR THEN
    RAISE_APPLICATION_ERROR(-20001, 'internal_error');
    -- Error number -29287
    WHEN UTL_FILE.invalid_maxlinesize THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_maxlinesize');
    -- Error number -29288
    WHEN UTL_FILE.invalid_filename THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_filename');
    -- Error number -29289
    WHEN UTL_FILE.access_denied THEN
    RAISE_APPLICATION_ERROR(-20001, 'access_denied');
    -- Error number -29290
    WHEN UTL_FILE.invalid_offset THEN
    RAISE_APPLICATION_ERROR(-20001, 'invalid_offset');
    -- Error number -29291
    WHEN UTL_FILE.delete_failed THEN
    RAISE_APPLICATION_ERROR(-20001, 'delete_failed');
    -- Error number -29292
    WHEN UTL_FILE.rename_failed THEN
    RAISE_APPLICATION_ERROR(-20001, 'rename_failed');
    -- Error number unknown
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001, 'other_error');
    end Process_Request;
    end TEST_UTL_FILE;
    Errors:
    ORA-20001: invalid_path
    ORA-06512: at "SYS.TEST_UTL_FILE", line 21
    ORA-06512: at line 3

  • Problem while using UTL_FILE

    Hi I am using UTL_FILE package for the first time. Code goes as below
    Line:-----
    create directory test_utl_file as 'C:\ORA File';
    declare
    file_handler utl_file.file_type;
    v_newline varchar2(200);
    begin
    file_handler := utl_file.fopen('test_utl_file','TEST_UTL_FILE.txt','r');
    loop
    begin
    utl_file.GET_LINE(file_handler,v_new_line);
    dbms_output.put_line(v_new_line);
    exception
    when others then
    dbms_output.put_line('-----------------------------');
    dbms_output.put_line('End of line reached');
    exit;
    end;
    end loop;
    utl_file.fclose(file_handler);
    end;
    Line:-----
    Eorror I am getting is
    ORA-06550: line 2, column 14:
    PLS-00201: identifier 'UTL_FILE' must be declared
    But I can access the UTL_FILE package using DESC.
    I am not able to understand the cause of error.

    796298 wrote:
    I am connected to SYSTEM user. Does it still needs to be granted the privilege. If it needs should I connect to SYS and grant the privilege ?Generally it's not a good idea to be producing code in the SYSTEM or SYS schemas. You should only log into those to carry out admin tasks such as granting privileges.
    Once you've granted your use the appropriate privilege to access UTL_FILE package you'll also need to alter a line in your code...
    file_handler := utl_file.fopen('test_utl_file','TEST_UTL_FILE.txt','r');should be...
    file_handler := utl_file.fopen('TEST_UTL_FILE','TEST_UTL_FILE.txt','r');The name of the directory object must be specified in UPPER case as that is the default case for objects created in oracle, and because it's passed as a string parameter to the FOPEN function, the case does matter.

  • Problem in using UTL_FILE.FOPEN with filename containing accent characters

    select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
    VALUE
    AL32UTF8
    declare
    l_output UTL_FILE.FILE_TYPE;
    filename varchar2(100) := 'Avenue des Champs-Élysées.txt';
    begin
    l_output := UTL_FILE.FOPEN ('UPLOAD_DIR', filename, 'W');
    utl_file.put_line (l_output, 'Testing');
    utl_file.fclose(l_output);
    end;
    The file in the UPLOAD_DIR becomes "Avenue des Champs-Élysées.txt"
    can anyone tell me what NLS settings I should use in order to create file with correct filename ?

    symplik wrote:
    The file in the UPLOAD_DIR becomes "Avenue des Champs-Élysées.txt"And what does the o/s file system support and what is the operating system's NLS settings?
    If there is a mismatch between what you do in your code in Oracle, and what the o/s is configured for, then this type of "+translation+" error is to be expected.

  • Cannot create a file using  UTL_FILE.FOPEN

    Dear All,
    I am using this syntax for creating a file in window
    i have declare this like this
    l_file_id UTL_FILE.file_type;
    l_file_name := 'DHL_'||110570284||'_'||TO_CHAR(SYSDATE,'ddmmyyyy')||'.txt'
    l_file_id :=UTL_FILE.FOPEN('C:\D2R',l_file_name,'W');
    Is this syntax work?
    My database version is oralce 10g
    Thanks

    First of all, UTL_FILE is PL/SQL package and is executed on database server side, not on client side. Therefore, it is trying to create file in directory C:\D2R on database sefrver. So if you want to create file in directory C:\D2R on your client box - you can't. Next point - you are specifying directory explicitly which old and obsolete syntax. It requires, for security reasons to add C:\D2R to init.ora parameter UTL_FILE_DIR, otherwise UTL_FILE will raise an error. You should use directory objects:
    CREATE DIRECTORY dir AS 'C:\D2R';and grant READ/WRITE on it to users. Then use:
    l_file_id :=UTL_FILE.FOPEN('DIR',l_file_name,'W'); -- use directory name in upper caseAnd keep in mind, as I already mentioned UTL_FILE is PL/SQL package and is executed on database server side which means it runs under OS user oracle. Therefore OS user oracle must have write permission on C:\D2R.
    SY.

  • Unable to create file using : =utl_file.fopen

    Hi Team,
    My issue is file is not getting created, i checked the permissions of the directory.
    No error is received while executing the below script .
    declare
    f1 utl_file.file_type;
    begin
    f1:=utl_file.fopen('TAX_CODE_OUT_FILE_PATH','test.txt','W');
    utl_file.put_line(f1,'memocan');
    utl_file.fclose(f1);
    end;
    Any suggestion why file is not getting created ?

    i tried the following :
    declare
    V1 VARCHAR2(32767);
    f1 utl_file.file_type;
    begin
    F1 := UTL_FILE.FOPEN('TAX_CODE_OUT_FILE_PATH','in.txt','R');
    UTL_FILE.GET_LINE(F1,V1,32767);
    UTL_FILE.FCLOSE(F1);
    end;
    Error is thrown as following ;
    Error report:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 537
    ORA-29283: invalid file operation
    ORA-06512: at line 6
    29283. 00000 - "invalid file operation"
    *Cause:    An attempt was made to read from a file or directory that does
    not exist, or file or directory access was denied by the
    operating system.
    *Action:   Verify file and directory access privileges on the file system,
    and if reading, verify that the file exists.
    Any suggestions ??

  • Security Exception while using OIM client API with Webcenter

    Hi,
    We are using OIM 11g Client api for creating user from our WebCenter portal application. But we are getting security as well as no such service exception while calling login from the OIM client.
    Exception::
    oracle.iam.platform.utils.NoSuchServiceException: java.lang.reflect.InvocationTargetException
         at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:197)
         at oracle.iam.platform.OIMClient.getService(OIMClient.java:174)
         at oracle.iam.platform.OIMClient.loginSessionCreated(OIMClient.java:209)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:136)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:114)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:193)
    Caused by: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[weblogic, Administrators]
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    oracle.iam.platform.utils.NoSuchServiceException: java.lang.reflect.InvocationTargetException
    Client Code::
    System.setProperty("java.security.auth.login.config", "Path to authwl.conf");
    System.setProperty("OIM.AppServerType", "weblogic");
    env = new Hashtable();
    env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL,"weblogic.jndi.WLInitialContextFactory");
    env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, "t3://host:14000/oim");
    client = new OIMClient(env);
    try {
    client.login(OIMUserName, OIMPassword);
    } catch (LoginException e) {
    e.printStackTrace();
    The exception is coming after executing the login code (not login exception).We logged into our application using weblogic user(even for any other user in OID,shared by OIM, is having same behaviour). The code is being executed from integrated webogic server and oim_server is running on a different server under a separate domain.
    Please suggest.
    Thanks

    There are files needed in your project.
    from the <OIMHOME>/config folder_
    xl.policy
    authwl.conf
    log.properties
    from the <OIMHOME>/ext folder_
    commons-logging.jar
    jakarta-oro-2.0.8.jar
    javagroups-all.jar
    jhall.jar
    log4j-1.2.8.jar
    mail.jar
    oscache.jar
    spring.jar
    wlfullclient.jar
    from the <OIMHOME>/lib folder_
    iam-platform-auth-client.jar
    iam-platform-context.jar
    iam-platform-pluginframework.jar
    iam-platform-utils.jar
    oimclient.jar
    XellerateClient.jar
    xlAPI.jar
    xlDataObjectBeans.jar
    xlUtils.jar
    xlVO.jar

  • Exception while using Nested types in Oracle

    Hi All,
    I am getting an exception while trying to use Nested types in Oracle. The same thing works in other systems. So it might be some problem with my configuration. Can anyone please help me out with this one. Thanks in advance..
    java.sql.SQLException: Internal Error
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1074)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1107)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:81)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:68)
    at oracle.sql.TypeDescriptor.initSQLName(TypeDescriptor.java:237)
    at oracle.sql.TypeDescriptor.getName(TypeDescriptor.java:198)
    at oracle.sql.StructDescriptor.getClass(StructDescriptor.java:1105)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:574)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:502)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:456)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBodyElements(OracleTypeCOLLECTION.java:1011)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBody(OracleTypeCOLLECTION.java:952)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:764)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearizeInternal(OracleTypeCOLLECTION.java:243)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:217)
    at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:891)
    at oracle.sql.ARRAY.getArray(ARRAY.java:315)
    at weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY.getArray(Unknown Source)
    Regards,
    Praveen G S

    Ok .. i got around this issue myself ..
    For others who might have had to face the same problem, let me tell them the problem that i had... i ll b happy if it helps someone ...
    The issue was improper privleges of the Nested Types in the schema to which my server was connecting. Once proper privelges were given, everything started working just fine ...

  • Procedure using utl_file.fopen

    Hi ,
    I want to open a file ,read it line by line and if i find one particular word i want to display the whole line.
    I tried writing a procedure but not getting desired output.
    DECLARE
    x utl_file.file_type;
    y varchar2(200);
    BEGIN
    x:= utl_file.fopen('TRACE1',DB_ora_111_trc.txt','R');
    LOOP
    BEGIN
    UTL_FILE.GET_LINE(x,y);
    if x='select' then
    dbms_output.put_line(x);
    end if;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN EXIT ;
    END;
    END LOOP;
    utl_file.fclose(x);
    END;
    Here i am opening a tkprof file and trying to grep for select word and if it is found,display the whole select query.The above is not showing any output.Kindly assist me since i am new to coding.
    Thanks

    user10698496 wrote:
    Hi,
    I am getting only these much as my output . I want to see entire select query.DECLARE
    f utl_file.file_type;
    s varchar2(2000);
    BEGIN
    f := utl_file.fopen('TRACE1','DB_ora_1118250.trc.txt','R');
    LOOP
    BEGIN
    UTL_FILE.GET_LINE(f,s);
    if lower(s) like '%select%' then
    dbms_output.put_line(s);
    end if;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN EXIT ;
    END;
    END LOOP;
    utl_file.fclose(f);
    END;
    SELECT uid,tname,str,acol,hcol,TO__CHAR(u_time,'DD-MM-YYYY
    SELECTgroup,name,address1,state,country,fax_no,
    PL/SQL procedure successfully completed.
    Ok, so that is telling us that you have your queries split over multiple lines?
    In that case you need to "switch on" the output of lines from the moment you find a "select" and then switch it off again when you get a line that indicates the end of the select. So let's assume your selects end with a ";" as the last character on the last line of the select, you can do something like this...
    DECLARE
      f utl_file.file_type;
      s varchar2(2000);
      in_select boolean;
    BEGIN
      f := utl_file.fopen('TRACE1','DB_ora_1118250.trc.txt','R');
      in_select := false;
      LOOP
        BEGIN
          UTL_FILE.GET_LINE(f,s);
          if lower(s) like '%select%' or in_select then
            dbms_output.put_line(s);
            in_select := not(s like '%;'); -- stop when we get to ";" at end of a line.
          end if;
        EXCEPTION
          WHEN NO_DATA_FOUND THEN EXIT ;
        END;
      END LOOP;
      utl_file.fclose(f);
    END;
    Also i attempted to cut only table name from the output select query.I tried something like o :=substr(s,instr(s,'from')+4);PFB the code and output.Pls let me know where am i going wrong.
    DECLARE
    2  f utl_file.file_type;
    3  s varchar2(2000);
    4  op varchar2(1000);
    5  BEGIN
    6  f := utl_file.fopen('TRACE_EXTRACT','DB_ora_1118250.trc.txt','R');
    7  LOOP
    8  BEGIN
    9  UTL_FILE.GET_LINE(f,s);
    10  if lower(s) like '%select%' then
    11  op :=substr(s,instr(s,'from')+4);
    12  dbms_output.put_line(op);
    13  end if;
    14
    15  EXCEPTION
    16  WHEN NO_DATA_FOUND THEN EXIT ;
    17  END;
    18  END LOOP;
    19  utl_file.fclose(f);
    20  END;
    21  /
    ECT uid,tname,str,acol,hcol,TO__CHAR(u_time,'DD-MM-YYYY
    ECTgroup,name,address1,state,country,fax_no,
    that's because there is no "from" on those lines, so the result of the instr is 0 and you are adding 4, so you are getting all characters from character 4 onwards.
    What you need in conjunction with my above suggestion is something like this...
    DECLARE
      f utl_file.file_type;
      s varchar2(2000);
      in_select boolean;
    BEGIN
      f := utl_file.fopen('TRACE1','DB_ora_1118250.trc.txt','R');
      in_select := false;
      LOOP
        BEGIN
          UTL_FILE.GET_LINE(f,s);
          if lower(s) like '%select%' or in_select then
            dbms_output.put_line(s);
            if lower(s) like '%from%' then
              dbms_output.put_line('TABLES: '||substr(s,instr(s,'from'+5))); -- +5 to get past the from and the space character after it.
            end if;
            in_select := not(s like '%;'); -- stop when we get to ";" at end of a line.
          end if;
        EXCEPTION
          WHEN NO_DATA_FOUND THEN EXIT ;
        END;
      END LOOP;
      utl_file.fclose(f);
    END;
    /

  • ORA-03123 while using UTL_FILE package in oracle forms 10g

    hi all,
    i have created a directory 'REPORTS' as 'E:\EXCEL_TESTING_FORM\' and give grant read,write this directory to scott.
    and also given grant execute on UTL_FILE to scott;
    i have written this code in a button-pressed trigger and my file name is somename.xls file
    After printing the first line like 7369SMITH3000 in a single cell when it is going to print the second employee record it is showing
    ORA-03123 inside the loop.
    CURSOR EMP_DATA IS
         SELECT * FROM SCOTT.EMP;
    C_REF EMP_DATA%ROWTYPE;
    L_FILE UTL_FILE.FILE_TYPE;
    V_PATH VARCHAR2(200) := '';
    BEGIN
         V_PATH := 'REPORTS';
    L_FILE := UTL_FILE.FOPEN (V_PATH,P_FILE_NAME, 'W');
    OPEN EMP_DATA;
    LOOP
         FETCH EMP_DATA INTO C_REF;
         EXIT WHEN EMP_DATA%NOTFOUND;
              UTL_FILE.PUT_LINE(L_FILE, TO_CHAR(C_REF.EMPNO));
              UTL_FILE.PUT_LINE(L_FILE, C_REF.ENAME);
              UTL_FILE.PUT_LINE(L_FILE, TO_CHAR(C_REF.SAL));
    END LOOP;
    CLOSE EMP_DATA;
    UTL_FILE.FFLUSH(L_FILE);
    UTL_FILE.FCLOSE(L_FILE);
    please guide me how to avoid that error and also how to print cell wise why because it is print in a single cell.
    please reply...

    hi Andreas Weiden,
    No it is not a network-drive. i have total 0f 3 drives
    one is of c drive for wind sp2 and in d i have loaded oracle database and i have created a directory on e drive i.e 'E:\EXCEL_TESTING_FORM\'
    in that i have created a excel file i.e called taru.xls.
    so i want to know where is the problem.
    please reply...

Maybe you are looking for

  • Startrfc - how to call with "input table"?

    I have not been able to get sapnwrfc for Perl to compile correctly on my AIX systems so i want to try something different. I started to investigate using startrfc to get my data but am running in to a problem. Problem Summary:  I want to get informat

  • Infrared receiver not working

    Can anyone suggest why the infrared facility on my MBP doesn't work? I have already made sure the disable remote control infrared receiver box in security prefs is unchecked and I have the message "This computer will work with any available remote".

  • How to send one email to multi-users using JavaMail ?

    I am using JavaMail API. I am working in "sending emails to users", I had already tested "one email to one user" and got success but when tried to send one email to multi-users then I failed to do that? Can anyone help me to do this? I have used the

  • Trailing space when using SELECTION-SCREEN COMMENT

    Hi All, I need to display a continuous text (length :130) in selection screen. I am trying with SELECTION-SCREEN COMMENT option and i m aware that we can display max of 79 characters. So i split the text into length: 70 & 60 and coded as below SELECT

  • Cause of Orphaned Users in Sharepoint

    This isn't really a problem. More of a question for best practices. We have a number of Orphaned users in our SharePoint environment. We have a way to remove orphaned users already. However, we want to prevent so many orphaned users from occurring ag