|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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('............... ............')); |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Problem with OJXQI - The Oracle Java XQuery API |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|