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.

Similar Messages

  • I am having problem while using ms word with anjal( OS X Lion 10.7.5 (11G63))

    i am having problem while using ms word with anjal  is not working properly but its working in facebook and other areas.i need and  its very important to using tamil fonts for my job.can anyone help me out from this problem.
    thanking you
    by
    moses

    Those who are knowledgable in this area (myself not among them) say that Word's support for Asian languages is faulty. The best word processor for that use is "Mellel."

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

  • Problems in using Windows Explorer with VPC Virtual PC?

    Has anybody experienced problems in using Windows Explorer with VPC Virtual PC?
    Lacking any "forbidden" or "appropriate usage" guidelines, I regularly use Windows Explorer (Windows 2000) to transfer file from the desktop. I have occasionally sensed that this might be wrong. Today I inadvertently clicked the MAC harddrive instead of the Desktop (within Windows Explorer) and caused all manner of mischief.
    Any other views please?

    Let me correct this:
    I regularly use Windows Explorer (Windows 2000) to transfer files from the "Mac" desktop
    Any ideas please Virtual PC VPC users?

  • AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM

    Hi friends,
    SUBJECT : AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM
    I'm not getting any sound while using web-cam.
    I tried recording my voice , and played.. i can see my video but audio
    Do we have any settings where i need to cross-check to make sure that everything being turned-on ?
    My laptop details:-
    HP Pavilion dv6 laptop
    Operating system Installed - Windows 7
    Can someone help me with this?
    Thanks
    kiran

    Hi,
    not sure if coincidence or the same question, but the same question got asked internally. The seeded option is required to get the OJSP filter installed. Here's the internal response
    ADF View integration with MDS not configured
    In web.xml, you need to have mds-ojsp intg enabled to load jspx base + customizations from MDS. In your web project in Jdev, go to ADFv project properties and select “Seeded customization” property. It would enable mds-jsp engine configuration in web.xml. If you want to use user personalization feature at runtime, you would need to select “User customization” property as well which would enable ADFv change persistence config in web.xml.
    Warning: Some of the metadata under ... is packaged as part of both WAR and MAR. This metadata cannot be accessed from WAR using MDS.
    For these two packages, you are including the files in both WAR & MAR. This warning conveys that since these base files are being put in MAR, at runtime they would be read from mds repository & not from WAR.
    Frank

  • Cannot insert Captivate Demo - filename contains illegal characters

    RoboHelp HTML v8 on XPpro. Captivate v4.
    I have created a simple Captivate v4 application demo and published to SWF.
    In my RHhtmlv8 project, I create a new topic, and choose Insert > Adobe Captivate Demo.
    The Insert dialog allows me to select my SWF file. It shows it in the Insert dialog and starts to play it.
    No matter what my SWF filename is (e.g. abc.swf, video1.swf, etc.), when I click the OK button in the Insert dialog, I get the error:
    'Unable to rename file, "abc.swf". The filename contains illegal characters.'
    I have searched the forums here and find no solution.
    How do you get support from this company? I went to the support link and it only showed Captivate as an option, even though I have a valid license for RH8 and have registered it. Yet - for 2 days now, I have not heard back from any support via that mechanism.
    Jeff

    Hi Jeff
    When you attempt to insert the demo, by chance do you still have the project open in the Captivate editor? If so, you likely need to close it there before attempting to insert into RoboHelp. I've seen all manner of weirdness with this.
    Another thing that seems to have happened recently that is worth looking at. When you Published your Captivate demo, did you Publish as AS2 or AS3? (For those that may wonder, AS refers to ActionScript. Similar to JavaScript and is the Flash programming language.)
    I've begun to notice issues with inserting Captivate content where I have published as AS3.
    Let us know... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Migrating from MySQL to Oracle 11gR2 containing accented characters

    Hello Gurus,
    I am going to migrate a MySQL database that contains accented characters. The collation of the tables holding these data is utf8_unicode_ci.
    I used SQLDeveloper to generate data migration scripts. After a test migration run, the web pages displays "?" instead of the accented character.
    I am currently tracing where the problem is.
    From what I have read, mysqldump uses utf8 as the default character set, so I assume the accented characters in <tablename>.txt files are in tact.
    Could the problem be on sqlldr? Has anyone come across this problem?
    I really would appreciate any help.
    Thanks

    Hi Srini, thanks for the reply.
    here is the result of select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AL32UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 11.2.0.1.0

  • Can't create file with filename contains user-defined character

    Dear all,
    I got a question about directory listing and file creation. My development OS is Win2K traditional chinese version and my JDK is 1.4.0 Internationation version.
    My program copy each of file into another directory. I call File.lists() to get an array of filename String, I then create the file in the destination directory. However, I got error while the filename contains some chararters that I created in my system only by Win2K character creation utility. I found those characters become "?" if I printf them. How could I overcome this problem? Thanks.
    ArthurPan

    The limitation here is not caused by Java at all.
    Java handles UNICODE characters, the concept of ASCII characters is only loosely retained by accident, mainly because the ASCII set is retained as is in UNICODE.
    The limitation here is the Operating System whose filesystem does not support UNICODE names. As far I as can remember, although the System default locale can be your language equivalent, the filesystem does not necessarily support UNICODE filenames even though it may actually be able.
    What you need to do is check the file.encoding property in Java and set that using the -Dfile.encoding=BIG-5 or whatever when starting your application. This may help with the file name problem.

  • 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

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

  • Problems in using Labview DLL with TestStand!

    Hi,
    I tried to put the VI's to create a TCP/IP Connection, read/write Data to it and close it inside a LabVIEW DLL and use these functions with TestStand.
    The problem is to get access to the ConnectionID generated as TCP Network Refnum in LabVIEW.
    I don't know how to specify the prototype entry for this Refnum in LabVIEW and how to read it with TestStand.
    Another try to pass an ActiveXReference of SequenceContext and use the SetValIDispatch method to set a local variable (Type: ActiveXReference) to the returned ConnectionID of the TCPOpen.VI wasn't successful too.
    It seems to me that the connectionID isn't a normal ActiveXReference.
    Regards,
    Sunny

    Hi Sunny -
    You should treat this parameter as a pointer to an int when calling the DLL from TestStand (or any language like C or C++). Note that you can't do anything with the value outside of LabVIEW since it only has meaning inside of LabVIEW. You can only pass it around for use in other VIs you call from TestStand.
    Hope this helps....
    Kyle G.
    National Instruments
    Kyle Gupton
    LabVIEW R&D
    National Instruments

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

  • 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

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

Maybe you are looking for