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 9228719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:23:39+00:00 2026-06-18T05:23:39+00:00

In the process of moving some applications from PHP and Delphi to Java-RS some

  • 0

In the process of moving some applications from PHP and Delphi to Java-RS some column entries are spoiling the show at this time.

After reading the data from mySQL with JPA into Java Pojos converting the result to XML using JaxB and trying to read back the result to JQuery / jqGrid a failure happens.

In the browser the problem simply shows at “not well formed”.
Looking at the details with the Eclipse XML editor gives the error message:

An invalid XML character (Unicode 0x0) was found in the element content of the document

Now I’d like to proceeed and fix the original data.

  1. How would an SQL query look like that looks for the rows that have
    invalid entries?
  2. How would an SQL query look like that fixes these
    rows?

Let’s assume the column with the problem is “name” in Table “Customer”

For question #1 I found:
SELECT name from customer where hex(name) like “%00”;

to work. For question #2 I am assuming that update with a left substring might work. I am not sure about the length in this case. It looks like length(name) will return the length including the terminating zero character. Will the update with left(length(name)-1) work correctly in this case?

I am not sure whether backup and restore of the database would keep the current somewhat corrupted database in shape. So it would also be helpful to know how the situation can be reproduced with an insert statement that creates null terminated strings on purpose.

  • 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-18T05:23:40+00:00Added an answer on June 18, 2026 at 5:23 am

    I think you should be able to transform the HEX() with something like

    UPDATE customer SET name=UNHEX(REPLACE(HEX(name), '00', ''));
    

    or simply

    UPDATE customer SET name=REPLACE(name, CHAR(0), '');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm the process of moving applications over from all in the public schema to
I'm in the process of moving some of our internal data visualization/analysis tools from
We are in the process of moving some software from our test environment into
I am in the process of moving some sites over to a new windows
I'm in the process of moving from ADO.NET to Linq. The application is a
Scenario: I am in the process of moving an application from access to C#
What are the limitations, unexpected pitfalls and performance traits of moving from in process
We are beginning the process of moving from Web Forms to MVC for all
I'm in the process of refactoring some code which includes moving folders around, and
I am in the process of moving the shared libraries to some custom jboss

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.