Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Location
    Atlanta, GA USA
    Posts
    20

    Unanswered: Unicode with XMLType?

    Hi again.

    Does anybody know of a way to get Unicode data in and out of XMLType columns? Other than changing the database character set to Unicode, that is :-)

    * xmltype.CreateXml takes a clob or varchar2, but not nclob or nvarchar2
    * xmltype.GetClobVal returns clob, not nclob
    * xmltype.GetStringVal returns varchar2, not nvarchar2

    I'm using Oracle 9iR2. I see that Oracle 10g "supports" xmltype encodings, but it looks really awkward using blobs and character set IDs. What happened to just plain nclob?

    Surely I'm missing something, since XML has been predominantly utf-8 since it's been in widespread use.

    Thanks,
    Philip

  2. #2
    Join Date
    Nov 2005
    Location
    Atlanta, GA USA
    Posts
    20
    This guy had the same problem and never got a response in the newsgroups. I have emailed him directly, and if he ever got an answer (and is willing to share) I'll post it here.

  3. #3
    Join Date
    Nov 2005
    Location
    Atlanta, GA USA
    Posts
    20
    Kurt's response, posted with permission:

    Our final solution was to set the NLS_DATABASE_CHARACTERSET to a unicode ( al32utf8 ) in order to create a Unicode database. We did not end up converting all the data types of our variable and columns as I mentioned in that posting. Although that may be a good solution if you are building a new system, our system was already in maintenance mode so that was to comprehensive of a change. Also, if you go with the a AL32UTF8, be aware of the NLS_LENGTH_SEMANTICS issue. Here is an excellent article on the topic. . http://www.oracle.com/technology/ora...ar/o23sql.html

    Oh yeah, XMLType would only seem to accept a VARCHAR2 parm, so by changing the db characterset, we got it to indirectly process Unicode data. Let me know if you find anything to the contrary, but this is my best understanding of the issue.

    Hope that helps,

    Kurt

  4. #4
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Good stuff. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •