Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7730131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:08:47+00:00 2026-06-01T06:08:47+00:00

I’m currently having non-utf-8 DB but I need to produce XMLType variable with utf-8

  • 0

I’m currently having non-utf-8 DB but I need to produce XMLType variable with utf-8 encoding. I’m having a workaround but there seems to be bug in the Oracle, see the following link:
https://forums.oracle.com/forums/thread.jspa?messageID=10238641

…and Oracle Support bug: 7698684

The bug causes random

ORA-1482: unsupported character set
ORA-6512: at "SYS.XMLTYPE", line 107

First of all I’m getting XMLType with dbms_xmlgen package. That XMLType is encoded with DB character set.

To convert it to utf-8 character set I do like this:

  • I convert XMLType variable to BLOB variable with getBlobVal method using NLS_CHARSET_ID
    (‘UTF8’) as parameter
  • I convert BLOB variable back to XMLType with XMLType constructor method using BLOB variable as first parameter and NLS_CHARSET_ID
    (‘UTF8’) as second parameter. This causes random error 🙁

Does anybody know any alternative solution for this?

  l_xml   := dbms_xmlgen.getXMLType(l_ctx);
  l_xml_b := l_xml.getBlobVal(C_UTF8_CHARSET_ID);
  l_xml   := XMLType(l_xml_b, C_UTF8_CHARSET_ID);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:08:48+00:00Added an answer on June 1, 2026 at 6:08 am

    I managed to do this with convert function. It was not possible to convert the whole xml document (even the clob value of it) but only element values.

    This was not working (XMLType constructor fails):

    l_xml := XMLType(convert(l_xml.getClobVal, 'UTF8'));
    

    So I had to put convert to the query string (this is just an example):

    select dbms_xmlgen.getXMLType(
      q'{select convert('ä', 'UTF8') myValue from dual}')
    from dual
    

    Finally I made a function which reads dictionary and loops through all columns of the given table/view and generates select statement string where all columns are converted separately to UTF8. This string can then be passed as parameter to the dbms_xmlgen.newContext function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I need to clean up various Word 'smart' characters in user input, including but
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.