Home » SQL & PL/SQL » SQL & PL/SQL » return xml in sys_refcursor
return xml in sys_refcursor [message #388359] Tue, 24 February 2009 08:06 Go to next message
maciego
Messages: 11
Registered: January 2009
Junior Member
i'm using hibernate with oracle... how return some selected data as xml inside sys_refcursor?

Thanks for any help...
Re: return xml in sys_refcursor [message #388365 is a reply to message #388359] Tue, 24 February 2009 08:36 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
you could use CAST to cast the data as an XMLTYPE.

More information about exactly what you want is required - for example, is the data currently stored as XML
Re: return xml in sys_refcursor [message #388372 is a reply to message #388359] Tue, 24 February 2009 08:45 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Letting Oracle create the XML from relational data does not make sense. If you are using hibernate, I take it you use Java (or .Net) at the 'receiving' end.
Those are way better and more flexible in converting this to XML then a database.
(according to my humble opinion)
Re: return xml in sys_refcursor [message #388380 is a reply to message #388372] Tue, 24 February 2009 08:56 Go to previous messageGo to next message
maciego
Messages: 11
Registered: January 2009
Junior Member
JRowbottom: data is not sotred as a xml... it is selected from some table...

Frank: beetwen oracle and java i have webservice and i don't want to retrieve from database list of object (-> selectes rows) therefore i want to return simple xml

Thanks for help
Re: return xml in sys_refcursor [message #388382 is a reply to message #388380] Tue, 24 February 2009 09:02 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Then I don't understand why you mention that you use Hibernate.
Re: return xml in sys_refcursor [message #388386 is a reply to message #388382] Tue, 24 February 2009 09:17 Go to previous messageGo to next message
maciego
Messages: 11
Registered: January 2009
Junior Member
becouse i use it to retieve data inside classes generated from wsdl file...
thanks form help. topic is closed i resignate from hibernate and xml...

[Updated on: Tue, 24 February 2009 09:19]

Report message to a moderator

Re: return xml in sys_refcursor [message #388387 is a reply to message #388386] Tue, 24 February 2009 09:20 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Even though this is not really Oracle related:
Hibernate is used to map relational data to objects; it is an ORM tool.
To map XML to objects, use an OXM tool like XMLBeans or Jaxb
Re: return xml in sys_refcursor [message #388520 is a reply to message #388380] Wed, 25 February 2009 02:40 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Oracle provies a suite of functions for converting data into xml

I generally create views on the data using these functions to return xml from the database. This lets you returns a single row with any required key values still visible to the database, and a large chunk of XML containing all the information that you're going to pass to an external system.
Previous Topic: insert data > 4000 bytes into clob datatype columns
Next Topic: Inline View Bug ?
Goto Forum:
  


Current Time: Fri Dec 09 21:45:13 CST 2016

Total time taken to generate the page: 0.07920 seconds