Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Xquery with Union

TrojanSpiritNov 7 2012 — edited Nov 7 2012
As I am not able to use IF-ELSE in Oracle for select statements, I am using UNION to discard one select query result set and to get resultset of other query depending upon the Parameter value.

Example of Normal Query:

Select FNAME , LNAME from EMP where Param.1 in ( 'NAME' , 'SURNAME' )

UNION

SELECT CITY , ADDRESS from EMP where Param.1 in ( 'LOCATION' , 'ADDRESS')

so when I give Param.1 as "NAME", it gives me the result set of first query while it discards resultset of other query as it will be null coz Param.1 i snot in 'Location' or 'ADDRESS".

Same wau if I give Param.1 as "ADDRESS", it gives me the resultset of 2nd query and discards 1st query resultset as it is null.

But same approach doesnot work for Oracle query with Xquery for following:

Select rtrim(XMLELEMENT( "Rowset" , XMLAGG ( RW.column_value) ) , ',' ) AS Orders
from EMPTABLE UL, XMLTABLE('Rowsets/Rowset/Row' PASSING UL.TEXT) AS RW

WHERE

[Param.1] IN ( 'NAME' , 'SURNAME' )

UNION

Select rtrim(XMLELEMENT( "Rowset" , XMLAGG ( RW.column_value) ) , ',' ) AS Orders
from ADDRESSTABLE UL, XMLTABLE('Rowsets/Rowset/Row' PASSING UL.TEXT) AS RW

WHERE

[Param.1] IN ( 'LOCATION' , 'ADDRESS' )


Here, if the Param.1 is "NAME" then the outcomes as <Rowset></Rowset> + Output of other query (which only thing I want)

How can i remove this <Rowset></Rowset> from the output?
This post has been answered by odie_63 on Nov 7 2012
Jump to Answer

Comments

843842
This is a network issue. Check all routers and firewalls if none of all are blocking the data.

This problem is not related to servlets. You got an exception of java.net package, not of javax.servlet package.
843842
Thanks a lot
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 5 2012
Added on Nov 7 2012
2 comments
1,990 views