• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 881
  • Last Modified:

How can I use xQuery on AS400 non web Application?

All, I have a XML document on AS400 and try to parse that document on AS400 using xQuery  and send the data to the Physical file How can I do that and this is non a Web application.

My Basic Questions is how can I use xQuery on AS400  non web Application?

2 Solutions
Gary PattersonVP Technology / Senior Consultant Commented:
Never used xQuery on AS/400 / iSeries, / IBM i, but here's what I found with a quick search:

Here are some brief instructions for installing the datadirect xQuery.  That may give you an idea of how to go about installing your distribution of choice:  


And here is a general "getting started" tutorial for using xQuery from Java:


Assuming you plan to code in Java, you'd just use JDBC to write the parsed output to a physical file (table).

If you are an RPG programmer, there is an easier way.  ILE RPG V5R4 and later has native opcodes for parsing XML.  Check out how easy it is to parse XML using the XML-INTO opcode:




When asking a quesiton line this, it is very helpful if you can provide some basic onformation, liek what programming language(s) you plan to use, or are able to use, what OS version you are running, and what xQuery distro you plan to use.

- Gary Patterson
I forgot about this article :)

Datadirect is a commercial product that needs a commercial license.
An alternative is Saxon, a pure Java XML processor, that can be used standalone or integrated into your application. I also made Saxon work on IBM i, so it is a viable solution.

Xquery is executed in Saxon like this
java -cp saxon9.jar net.sf.saxon.Query -q:<xquery-file> -s:<xml-input-file>
OramcleAuthor Commented:
Thank you All.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now