SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old July 11th, 2003, 10:59 AM
dayal_78 dayal_78 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 dayal_78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem with OJXQI - The Oracle Java XQuery API

Oracle Server Version: 9.2.0.3.0

I have installed the oracle xdk kit and oracle xquery package.

I created one table of XMLTYPE and inserted an xmldocument in the table.

Now using OJXQI, I am trying to query the database with the following xquery in my java program:

"let $O := sqlquery(\"select * from xmltable\")/ROW \n" +
"for $j in document($O) /AccountData/:Customer \n" +
"where $j/LastName = \"hunCT9S\" \n" +
"return \n" +
"$j/FirstName";

The result from the above query is 2001 (which is equal to the total number of nodes in my xml document but not the exact result).

The result should be: <FirstName>......</FirstName> and I can get this result by executing the following xquery on a native xml database:

"for $c in document('/MerchantAccountData')/AccountData/:Customer \n" +
"where $c/LastName = \"hunCT9S\" \n" +
"return \n" +
"$c/FirstName";

Please inform me about how to formulate the above xquery to get the correct result on Oracle 9i.
thanks in advance.

A LITTLE ADDITION TO THE QUESTION ABOVE:
These are the table details that I created on oracle 9i
Table name: xmltable

[create table xmltable of xmltype;]

I inserted one row in the above table with the syntax:
insert into xmltable values(xmltype('...............
............'));

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Problem with OJXQI - The Oracle Java XQuery API


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway