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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:07:26+00:00 2026-05-30T04:07:26+00:00

We use a Java-based application to deploy XML files, which are written to an

  • 0

We use a Java-based application to deploy XML files, which are written to an Oracle database. The XML blobs in the db are stored as NCLOB data types. How would I go about getting the NCLOB XML data from the database and back into XML format? Would I need to use Java (I’m a complete Java noob, BTW), or could I use PowerShell here (my preference)? And depending on the method, how would I do this?

The reason I want to do this is mostly for pre/post deployment validation (compare the XML content before and after it’s been deployed).

Thanks in advance,
Keith

  • 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-05-30T04:07:28+00:00Added an answer on May 30, 2026 at 4:07 am

    Here’s what I’ve done in the past to read/write XML in a Oracle CLOB using ODAC. This should work for NCLOB with very little modification.

    # Load ODAC. This might fail if it is not installed or is the wrong bitness.
    $assembly = [System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess")
    
    # Connect to Oracle.
    $connStr = 'Data Source=hostname:1521/sidname; User Id=sys; Password=password; DBA Privilege=SYSDBA;'
    $conn = New-Object Oracle.DataAccess.Client.OracleConnection -ArgumentList $connStr
    $conn.Open()
    
    # Query the table.
    $q = "select MY_CLOB_FIELD from My_Table"
    $command = new-object Oracle.DataAccess.Client.OracleCommand($q, $conn)
    
    # Process records.
    $reader = $command.ExecuteReader()
    while ($reader.Read()) {
        # Read the CLOB field and cast to an XML document.
        $xmlDoc = [xml] $reader.getstring(0) # XML
    
        #... XML Processing Here ....
    
        # Commit the updated XML.
        $sql = "UPDATE My_Table SET MY_CLOB_FIELD = :1"
        $updateCmd = New-Object Oracle.DataAccess.Client.OracleCommand ($sql, $conn)
    
        $param = New-Object Oracle.DataAccess.Client.OracleParameter (
            "xml", #Name
            [Oracle.DataAccess.Client.OracleDbType]::Clob, #Type
            $xmlDoc.OuterXml, #Data
            'Input' #Direction
        )
    
        $newParam = $updateCmd.Parameters.Add($param) 
        $result = $updateCmd.ExecuteNonQuery()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a typical Flex-based application that was written to use a Java/Hibernate/MySQL backend.
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
I have a web-based application and a client, both written in Java. For what
I have web services written using java which interacts with the android application only
We have a small java based server (a simple app which fetches data using
I'm looking for a good easy to use Java based Quadratic Programming (QP) solver.
We use iText to generate PDFs from Java (based partly on recommendations on this
I'm trying to use CDI for my JSF/Java EE application. I have the following
I'd like to use memcached in my java web application, and after some digging
I have a java web application based on Spring MVC. The task is to

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.