Inserting special french characters into UTF8 database

Hello ,
we have a database of release 10.2.0.5.0 with the following NLS settings:
PARAMETER
VALUE
NLS_CALENDAR
GREGORIAN
NLS_CHARACTERSET
UTF8
NLS_COMP
BINARY
NLS_CURRENCY

NLS_DATE_FORMAT
DD.MM.RR
NLS_DATE_LANGUAGE
GERMAN
NLS_DUAL_CURRENCY

NLS_ISO_CURRENCY
GERMANY
NLS_LANGUAGE
GERMAN
NLS_LENGTH_SEMANTICS
BYTE
NLS_NCHAR_CHARACTERSET
AL16UTF16
NLS_NCHAR_CONV_EXCP
FALSE
NLS_NUMERIC_CHARACTERS
NLS_SORT
GERMAN
NLS_TERRITORY
GERMANY
NLS_TIME_FORMAT
HH24:MI:SSXFF
NLS_TIMESTAMP_FORMA
DD.MM.RR HH24:MI:SSXFF
NLS_TIMESTAMP_TZ_FORMAT
DD.MM.RR HH24:MI:SSXFF TZR
NLS_TIME_TZ_FORMAT
HH24:MI:SSXFF TZR
When executing a script including special french characters with SQL*Plus (or with a job of Cloud Control) the result in the database shows up wrong:
e.g. FR R�au instead of  FR Réseau
When checking the HEX-code of the special french characters in the script these are correct:
é => E9
Setting the environment variable NLS_LANG to FRENCH_FRANCE.UTF8 before executing the script does not make any difference at all.
When checking the sign � in the string FR R�au with the dump function of SQL*Plus I get this result:
Typ=1 Len=3 CharacterSet=UTF8: e9,73,65
Seems to be OK - but why does it get displayed wrong? Is the client - in our case a application - responsible for the "how to display"?
Any help will be appreciated!
Rgds
Jan

Hi,
If you have My Oracle support access I suggest to check one of following two documents:
Oracle Metalink: The correct NLS_LANG in a Windows Environment Doc ID: 179133.1 
Oracle Metalink: The correct NLS_LANG setting in Unix Environments Doc ID: 264157.1
depending your env.
Check your data using SQL Developer and see if it displays well. If yes your data is ok in db.

Similar Messages

  • Insert french characters into the database

    Hi,
    My user requirement is to insert french characters into the db. However he has set as per my suggestion of altering session alter session set nls_language='french' he can't insert french characters. Is this using alter session helps to retrieve only the outputs in french language or to insert too?
    Please help.
    Version : oracle 8i
    nls_parameters at database level:
    SQL> select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET US7ASCII
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_NCHAR_CHARACTERSET US7ASCII
    NLS_RDBMS_VERSION 8.1.7.0.0

    Your database character set is US7ASCII : you can only insert ASCII characters which is OK for most French characters but not all. This cannot work for:
    àéèùçChanging NLS_LANGUAGE won't help. You need to change database character set to WE8MSWIN1252 for example. This should be easy in your case because US7ASCII is a binary subset of many others characters set. Please read http://docs.oracle.com/cd/A87860_01/doc/server.817/a76966/ch3.htm#47136

  • Problem inserting text with special Hungarian characters into MySQL database

    When I insert text into my MySQL db the special Hungarian
    characters (ő,ű) they change into "?".
    When I check the
    <cfoutput>#FORM.special_character#</cfoutput> it gives
    me the correct text, things go wrong just when writing it into the
    db. My hosting provider said the following: "please try to
    evidently specify "latin2" charset with "latin2_hungarian_ci"
    collation when performing any operations with tables. It is
    supported by the server but not used by default." At my former
    hosting provider I had no such problem. Anyway how could I do what
    my hosting provider has suggested. I read a PHP related article
    that said use "SET NAMES latin2". How could I do such thing in
    ColdFusion? Any suggestion? Besides I've tried to use UTF8 and
    Latin2 character encoding both on my pages and in the db but with
    not much success.
    I've also read a French language message here in this forum
    that suggested to use:
    <cfscript>
    setEncoding("form", "utf-8");
    setEncoding("url", "utf-8");
    </cfscript>
    <cfcontent type="text/html; charset=utf-8">
    I' ve changed the utf-8 to latin2 and even to iso-8859-2 but
    didn't help.
    Thanks, Aron

    I read that it would be the most straightforward way to do
    everything in UTF-8 because it handles well special characters so
    I've tried to set up a simple testing environment. Besides I use CF
    MX7 and my hosting provider creates the dsn for me so I think the
    db driver is JDBC but not sure.
    1.) In Dreamweaver I created a page with UTF-8 encoding set
    the Unicode Normalization Form to "C" and checked the include
    unicode signature (BOM) checkbox. This created a page with the meta
    tag: <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />. I've checked the HTTP header with an online
    utility at delorie.com and it gave me the following info:
    HTTP/1.1, Content-Type: text/html; charset=utf-8, Server:
    Microsoft-IIS/6.0
    2.) Then I put the following codes into the top of my page
    before everything:
    <cfprocessingdirective pageEncoding = "utf-8">
    <cfset setEncoding("URL", "utf-8")>
    <cfset setEncoding("FORM", "utf-8")>
    <cfcontent type="text/html; charset=utf-8">
    3.) I wrote some special Hungarian chars
    (<p>őű</p>) into the page and they displayed
    well all the time.
    4.) I've created a simple MySQL db (MySQL Community Edition
    5.0.27-community-nt) on my shared hosting server with phpMyAdmin
    with default charset of UTF-8 and choosing utf8_hungarian_ci as
    default collation. Then I creted a MyISAM table and the collation
    was automatically applied to my varchar field into wich I stored
    data with special chars. I've checked the properties of the MySQL
    server in MySQL-Front prog and found the following settings under
    the Variables tab: character_set_client: utf8,
    character_set_connection: utf8, character_set_database: latin1,
    character_set_results: utf8, character_set_server: latin1,
    character_set_system: utf8, collation_connection: utf8_general_ci,
    collation_database: latin1_swedish_ci, collation_server:
    latin1_swedish_ci.
    5.) I wrote a simple insert form into my page and tried it
    using both the content of the form field and a hardcoded string
    value and even tried to read back the value of the
    #FORM.special_char# variable. In each cases the special Hungarian
    chars changed to "q" or "p" letters.
    Can anybody see something wrong in the above mentioned or
    have an idea to test something else?
    I am thinking about to try this same page against a db on my
    other hosting providers MySQL server.
    Here is the to the form:
    http://209.85.117.174/pages/proba/chartest/utf8_1/form.cfm
    Thanks, Aron

  • Problem inserting special Hungarian characters into db

    Hi,
    I've posted this question in the database connection forum
    but put it here too because I don't know where to fit better.
    I read that it would be the most straightforward way to do
    everything in UTF-8 because it handles well special characters so
    I've tried to set up a simple testing environment. Besides I use CF
    MX7 and my hosting provider creates the dsn for me so I think the
    db driver is JDBC but not sure.
    1.) In Dreamweaver I created a page with UTF-8 encoding set
    the Unicode Normalization Form to "C" and checked the include
    unicode signature (BOM) checkbox. This created a page with the meta
    tag: <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />. I've checked the HTTP header with an online
    utility at delorie.com and it gave me the following info:
    HTTP/1.1, Content-Type: text/html; charset=utf-8, Server:
    Microsoft-IIS/6.0
    2.) Then I put the following codes into the top of my page
    before everything:
    <cfprocessingdirective pageEncoding = "utf-8">
    <cfset setEncoding("URL", "utf-8")>
    <cfset setEncoding("FORM", "utf-8")>
    <cfcontent type="text/html; charset=utf-8">
    3.) I wrote some special Hungarian chars
    (<p>őű</p>) into the page and they displayed
    well all the time.
    4.) I've created a simple MySQL db (MySQL Community Edition
    5.0.27-community-nt) on my shared hosting server with phpMyAdmin
    with default charset of UTF-8 and choosing utf8_hungarian_ci as
    default collation. Then I creted a MyISAM table and the collation
    was automatically applied to my varchar field into wich I stored
    data with special chars. I've checked the properties of the MySQL
    server in MySQL-Front prog and found the following settings under
    the Variables tab: character_set_client: utf8,
    character_set_connection: utf8, character_set_database: latin1,
    character_set_results: utf8, character_set_server: latin1,
    character_set_system: utf8, collation_connection: utf8_general_ci,
    collation_database: latin1_swedish_ci, collation_server:
    latin1_swedish_ci.
    5.) I wrote a simple insert form into my page and tried it
    using both the content of the form field and a hardcoded string
    value and even tried to read back the value of the
    #FORM.special_char# variable. In each cases the special Hungarian
    chars changed to "q" or "p" letters.
    Can anybody see something wrong in the above mentioned or
    have an idea to test something else?
    I am thinking about to try this same page against a db on my
    other hosting providers MySQL server.
    Here is the to the form:
    http://209.85.117.174/pages/proba/chartest/utf8_1/form.cfm
    Thanks, Aron

    Some new info about the advancements in my project:
    I've tried to make the insertion at a third hosting
    provider's MySQL server with my 'everything is UTF-8' test case and
    IT'S DONE! There are my lovely spec chars :-)
    Then I've checked the char encoding according -Per's tip in
    all of my so far used test MySQL dbs and it reported that
    'CHARSET=utf8 COLLATE=utf8_hungarian_ci' so this part seems to me
    OK.
    I asked my hosting provider where my production app should
    run about the db driver and they told it's JDBC (what version of
    Jconnect still donno') and they are ready to append
    &characterSetResults=UTF-8 to the JDBC url connection string
    (somebody told this tip also as a possible soultion) but they asked
    me to provide the complete connection string to be used for my
    datasource. I've tried to compose it in my localhost development
    environment in ColdFusion Admin but it gave me a Connection
    verification failed error. So I think I did something wrong and
    need help to write the correct connection string that can be passed
    to the hosting provider. So the connection string structure I tried
    to use in the JDBC URL field of the datasource area of CFAdmin is
    something like this:
    jdbc:mysql://someipaddresshere/mydbname&characterSetResults=UTF-8
    How can it be corrected?
    Thanks, Aron

  • Issue of inserting greek characters into Oracle database using ICAN505

    Hi All,
    We are currently facing an issue of inserting greek characters into Oracle database using ICAN505.
    We receive a file containing greek characters.The values from the file should be inserted into the database.We are reading the file using file OTD with default encoding.
    The file can contain english characters too other than greek characters.
    The database NLS_CHARACTERSET is AL32UTF8.
    When I insert using an insert statement directly ,the values get inserted properly into the DB table.
    Inserting the same values using code results in improper characters getting inserted into the table in the database.
    Please help....
    Thanks in advance !!

    Globalization forum?
    Globalization Support
    It works for SQL Developer, which does not depend on NLS_LANG, so I suspect a problem with your NLS settings.

  • French characters, eastern european database

    Hi,
    I have a 11.2 database with the following settings:
    NLS_CHARACTERSET EE8MSWIN1250
    NLS_NCHAR_CHARACTERSET AL16UTF16
    Is there any way I could insert all the french accented characters into
    this database or the nls_characterset forbids that, even if the
    nls_nchar_characterset can handle french accents? I created a test
    table with one nvarchar2 column, but there are characters that lose
    their accent after creation. (è for example). I tried it from SQLDeveloper, to eliminate nls_lang problems.
    Thanks,
    Krisztian

    Using NVARCHAR2 or NCHAR for the character data types should work- the AL16 set should handle most characters, just not as many as UTF8. As long as client programs have the correct NLS_LANG setup.
    If the coding gets sloppy and (tries to) save unicode values into VARCHAR2 or CHAR data types it will very likely get incorrectly translated as the data is stored, and there won't be any way to get the proper character codes back to the client.
    The N{types} will also consume more storage space- up to 4 bytes per character- try this out, and see the user_segments.bytes for the tables:
    create table ctest ( chartest varchar2(1000) )
      -- tablespace <tblspc>
    create table ntest ( nchartest nvarchar2(1000) )
      -- tablespace <tblspc>
    begin
       for i in 1..50000 loop
          insert into ctest values (  rpad( 'z', 1000, 'a'));
          insert into ntest values (  rpad( 'b', 1000, 'b'));
       end loop;
    end;
    select SEGMENT_NAME, sum( BYTES ) / 1024 / 1024 as mb from user_segments
    where segment_name in ('CTEST','NTEST') group by SEGMENT_NAME

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • ORA-01461 when trying to insert text 4000 characters into a CLOB column

    I work on a Windows application that connects to databases using ODBC. I'm currently working on adding Oracle support to the application, but I'm running into a lot of problems inserting strings of more than 4000 characters into CLOB columns. First, I tried to do that directly using code similar to the following (setup, cleanup, and error checking snipped for clarity).
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) ('long string', 1)");
    SQLExecDirect(hStmt,query,strlen(query));
    Of course, "long string" was really a string of more than 4000 characters. When I did that, I got an error indicating that I needed to use bind parameters for strings that long. However, bind parameters don't seem to work either. I changed my code to something like the following:
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    +unsigned char *str=NULL;+
    int str_size;
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) (:strvar, 1)");
    SQLPrepare(hStmt,query,SQL_NTS);
    str = (unsigned char*)malloc(6000 * sizeof(unsigned char));
    SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARBINARY, 0, 0, str, sizeof(str), &str_size);
    strcpy(str,'long_string');
    str_size = SQL_NTS;
    SQLExecute(hStmt);
    This code works fine when 'long_string' is less than 4000 characters. When it's greater than that, I get the following error:
    +[Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column+
    I'm using Visual Studio.NET 2003 on Windows XP, and Oracle client 11.1.0.6.0. My server version is as follows:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I thought I read somewhere that this is a known bug with Oracle 10.2.0.1.0, but I can't seem to find the reference now. Can anyone confirm this or provide some assistance with this problem? Frankly, it seems kind of ridiculous that I can't do something as simple as inserting a reasonably sized amount of text into a CLOB column. I'm considering using BFILEs instead, but that would be kind of a pain to fit into our application, so I'd prefer not to do this if at all possible.
    Thanks in advance for any help.

    I found this link referring to a similar problem that was apparently fixed in version 10.2.0.4 of the server: ORA-01461: can bind a LONG value only for insert into a LONG column Should I try to upgrade the server and see if that fixes things?

  • Insert Fixed Width data into SQL database.

    I have a file sent from a client that I need to get into a SQL database.
    The file name is ELIG and it is in a flat file, fixed width format.
    I am just going round and round how to get the data into a database using SSMS.
    Because another user is going to be doing this in the future it needs to be easy.
    I tried tasks, import data, flat file, file path and then "Fixed Width", but it puts all of it in one field.
    the data does NOT have headers either.
    I'm not good at this kind of thing so would appreciate any help I can get.
    Gee

    Yes I saw Uri's request and I'd love to comply, since this is giving me such a hard time, but the data is too sensitive and I would be shunned by my employer and thrown out into the street.
    I've been all over google trying to find a solution.  I'm still a bit of a novice, but even so, I have never found data that is so hard to normalize.  Just error after error.
    Gee
    Hi Gee,
    I can understand your issue :-)
    it is a common issue that people think that we can read minds, troubleshoot issues without having the option to test it and without any information regarding the issues. It is like going to the children doctor and ask him to treat your children without taking
    the your children to the doctor. If you can not take the children to the doctor, then you  might need to take a doctor to the your children!
    Troubleshooting can be tedious, because there may be quite some information you will need to supply. If you can not post the information in public, then maybe you need to get a private supporting, but this will cost you (your boss/company).
    Option 1: Create a case study which is based on your real issue. Use different DDL and DML (database structure and data) than the real database, and reproduce the issue in a way that you can post us the information that we need. We have
    to get the ability to reproduce the issue in our server as well, if you need our support.
    Option 2: Use the real database information with private support,
    after the supporter sign a Confidentiality agreement. If you check people profiles in the forum, then you will find that most of the supporters here are actually work as consultants and they give support on a daily
    bases. This is our job. In the forum we come to help volunteer, but
    there is a reason why people continue to pay for support. free public support do not fit all :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Insert a large file into a Database?

    I have the following situation and am unsure of the best solution.
    I have to do an update on a record within an MS SQL Server database, adding files that are potentially 50mb plus in size.
    Basically I would like to read this file into the database bit by bit so as not to get OutOfMemoryExceptions thrown whilst attempting to load a large file into memory.
    Is there a way I can open the file and read x number of bytes at a time into the database, say with the FileInputStream.read(byte[]) in a while loop.

    My preference would be to save the path of the file to the Database, but the requirements state the file has to be stored within a Database!
    My problem is I am not sure if the preparedStatement.setBinaryStream() will work the way I would like.
    I think this:
    preparedStatement.setBinaryStream( 1, in.read(), 50000);
    will just read the whole file into memory and error with OutOfMemoryException. Or will it read in a byte at a time?
    I would like to Do Something like:
    byte[] data = new byte[1024];
    preparedStatement.setBinaryStream( 1,
    while((eof = in.read(data)) != -1), 50000);
    which obviously will not work, but I hope you get what I would like to try and do.
    Put in words "pass small portions of the file from the Disk through JDBC into the database till the End Of File is reached".
    Thanks for the response in advance.

  • Insert chinese big5 characters into database

    database: mysql
    default charset of web page: utf-8 (specified in apache, all
    pages are in utf-8)
    if I enter english, database insert is ok but if I enter
    chinese, error = "You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near '?, ?)' at line 1"
    display inputted fields are OK.
    *** form.cfm ***
    <form action="insert.cfm" method="post">
    name: <input type="text" name="name"
    value=""><BR>
    Password: <input type="text" name="password"
    value=""><BR>
    <input type="submit" name="login_user"
    value="insert"><BR>
    </form>
    *** insert.cfm ***
    <cfoutput>
    #Form.name#<Br>
    #form.password#<br>
    </cfoutput>
    <cfquery name="insert" datasource="test">
    insert into test (name,password) values ('#Form.name#',
    '#Form.password#')
    </cfquery>

    dynason wrote:
    > database: mysql
    > default charset of web page: utf-8 (specified in apache,
    all pages are in
    > utf-8)
    what version of cf5? what version of mysql? has to be at
    least 4.1. is the db,
    etc. setup to handle that encoding? do you really want to use
    BIG5 instead of
    unicode? what db driver? it can't be ODBC.

  • XMLType.extract cannot show special French characters in select statement

    Hi,
    The (e acute) é characters get garbled when they are retrieved from the
    XMLType column of a regular table.
    How can we fix to get (e acute) é characters properly?
    We both tried setting "setenv NLS_LANG French_France.WE8ISO8859P1" and
    "setenv NLS_LANG French_France.WE8DEC" before loading the table.
    Database version:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionThe sample test case is as follows:
    --connect to any schema where you can store XMLType
    set long 2000;
    set pagesize 2000;
    set serveroutput on;
    --delete from test;
    drop table test;
    create table test (id number, xmldata XMLType);
    declare
    featureDescriptorXML  CLOB;
    xml_type XMLType;
    new_xml_type XMLType;
    myName varchar2(100);
    myName2 varchar2(100);
    myName3 varchar2(100);
    stmt varchar2(4000);
    begin
    featureDescriptorXML :=
    '<?xml version="1.0" encoding="UTF-8"?>' ||
    '<abc:TheFeature xmlns:' || 'de' || '="' || 'http://abc.klmno.org/fghde' || '" xmlns:abc="http://www.ghijklmn.net/abc"' ||
    ' xmlns:xyz="http://www.ghijklmn.net/xyz">' ||
    '<abc:Name>de:MyGénérique</abc:Name>' ||
    '</abc:TheFeature>';
    xml_type := xmltype(featureDescriptorXML);
    myName := xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
    dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType variable is ' || myName);
    -- can show French chars
    insert into test(id, xmldata) values(20, xml_type);
    stmt := 'select t.xmldata.extract(''/abc:TheFeature/abc:Name/text()'', ''xmlns:abc="http://www.ghijklmn.net/abc"'').getStringVal() from test t';
    execute immediate stmt into myName2;
    dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is ' || myName2);
    -- cannot show French chars
    stmt := 'select  t.xmldata from test t';
    execute immediate stmt into new_xml_type;
    myName3 := new_xml_type.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal();
    dbms_output.put_line('abc:Name value stored in VARCHAR2 variable from first XMLType column and then from XMLType variable in 3rd version is ' || myName3);
    -- cannot show French chars
    end;
    select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal()
    from test t;
    -- Cannot show French chars
    select t.xmldata.extract('/abc:TheFeature/abc:Name/text()', 'xmlns:abc="http://www.ghijklmn.net/abc"').getStringVal() "myname"
    from test t;
    -- Cannot show French chars
    select t.xmldata.getCLOBVal() from test t;
    -- Cannot show French chars
    select t.xmldata from test t;
    -- Can show French charsOutput is as follows with setenv NLS_LANG French_France.WE8ISO8859P1
    and NLS_DATABASE_PARAMETERS are as follows:
    SQL> select * from nls_database_parameters;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CHARACTERSET               WE8DEC
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    PARAMETER                      VALUE
    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.2.0
    20 ligne(s) sélectionnée(s).
    Table creé.
    abc:Name value stored in VARCHAR2 variable from XMLType variable is
    de:MyGénérique
    abc:Name value stored in VARCHAR2 variable from XMLType column in 2nd version is
    de:MyGénérique
    abc:Name value stored in VARCHAR2 variable from first XMLType column and then
    from XMLType variable in 3rd version is de:MyGénérique
    Procdure PL/SQL terminée avec succès.
    T.XMLDATA.EXTRACT('/ABC:THEFEATURE/ABC:NAME/TEXT()','XMLNS:ABC="HTTP://WWW.GHIJK
    de:MyGénérique
    myname
    de:MyGénérique
    T.XMLDATA.GETCLOBVAL()
    <?xml version="1.0" encoding="DEC-MCS"?>
    <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
    klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
      <abc:Name>de:MyGénérique</abc:Name>
    </abc:TheFeature>
    XMLDATA
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <abc:TheFeature xmlns:de="http://abc.klmno.org/fghde" xmlns:abc="http://www.ghij
    klmn.net/abc" xmlns:xyz="http://www.ghijklmn.net/xyz">
      <abc:Name>de:MyGénérique</abc:Name>
    </abc:TheFeature>We also tried setting NLS_CHARACTERSET to AL32UTF8
    via ALTER DATABASE CHARACTER SET,
    and then shutting down the database and restarting it.
    But, that did not help.
    Thanks

    Good to hear then, you have not yet got a SR on your hands.
    One of the reasons I hate NLS issues is that me first one had to do with an client browser/ application server and database setup that involved not equal settings between the app.server and the database. Always, always fully check that the app.server (on all fronts) have the same NLS settings as the database so that you avoid unnecessary conversion between the middle tier and the database tier. "On all fronts" means, as I once painfully discovered, possible NLS settings in a registry, app.server configuration file, java application in the JVM, etc, etc, etc. Another issue is that JDBC drivers, AFAIK, have issues with "opaque data types" (http://en.wikipedia.org/wiki/Opaque_data_type) like "XMLTYPE" so, to be sure, I would advice to transport the "XML content" in a data type which is supported much longer like "CLOB". In such cases, NLS conversions shouldn't take place. There are exceptions of course, one I can think of right now is when you move Binary XML content via the binary xml transport method (can't remember right now the proper java classes to use for this) between the client and server to obtain performance gains due to among others less and more efficient data transport across the network and avoiding validation and post parse overhead during the Binary XML content handling in the database.
    Looked it up anyway :-) the following is part of the 11.2 Oracle XDK
    Binary XML usage with Java:
    http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10708/adx_j_xmlbin.htm#BAJFBGGB
    Scalable DOM:
    http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10708/adx_j_parser.htm#CCHGIADJ

  • Special French characters not displaying properly

    Hi:
    I am using Weblogic 9.2, struts 1.2, JDOM,and ejb.
    I read special characters from the properties files using struts but when I assigned it to xml tags(JDOM elements) it is not showing properly in the xml tags.
              Element header = new Element("header");
              while(elementListItor.hasNext())
                   Element child = (Element)elementListItor.next();
                   String name = child.getName();
                   header.addContent(new Element(name).setText("Montant pay?", name)));
                   i++;
    Yours,
    Desperate.

    Hello,
    If you are displaying the report output as a PDF output then you need to make sure that:
    -NLS_LANG is set to French
    -the fonts used in the report are installed on the PC
    -the characters are stored correctly in the database
    -PDF subset is configured
    How to Use Font Subsetting in Reports for PDF Output (Doc ID 207711.1)
    Regards,
    Alex

  • urgent insert Date with Time into Access Database

    i found the following codes from the forum to insert date into microsoft access database:
    java.sql.Date date = new java.sql.Date((new java.util.Date()).getTime())
    stmt.executeUpdate("INSERT INTO Testing " +"VALUES (#"+date+"#)");
    but i need to insert the date together with its time so may i know how can i do it?

    thanks alot i works... but it allow only one value to be inserted.
    so i try the codes below:
    Timestamp ts=new Timestamp(tryDate.getTime());
    PreparedStatement p = connection.prepareStatement("insert into testing values(?,?)");
    p.setTimestamp(1,ts);
    p.setString(2,theMsg.getContent());
    p.executeUpdate();
    and error is this:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2564)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:136)
         at DBIncomingQueue.insertMessage(DBIncomingQueue.java:84)
         at DBIncomingQueue.main(DBIncomingQueue.java:213)

  • How to insert the sysdate time into the database

    hi all,
    when i execute the following query,
    insert into table_name
    (date_field)
    values
    (to_date(sysdate, 'yyyy/mm/dd hh24:mi:ss'));
    The value is inserted as 08-02-12 12:00:00. In this query, it always stores the default time as 12 a.m.
    But i need to insert the original system time not the default one.
    please help me how to rectify it.

    I do not understand as to why you are using the to_date function on sysdate since sysdate is already in date format.
    If date_field is of the data type date, then the following dml should work.
    insert into table_name(date_field) values (sysdate);
    In case date_field is a varchar2 field and you want to store the date and time in a string format, then the following statement should work.
    insert into table_name (date_field)
    values (to_char(sysdate, 'yyyy/mm/dd hh24:mi:ss'));

Maybe you are looking for