how to retrive xml data for using sql query?
Answers were Sorted based on User's Feedback
SELECT XMLELEMENT
("Emp", XMLELEMENT("name", e.fname ||' '|| e.lname),
XMLELEMENT ( "hiredate", e.hire))
AS "RESULT"
FROM employees e
WHERE employee_id > 200 ;
This query produces the following typical XML result:
RESULT
-----------------
<Emp>
<name>John Smith</name>
<hiredate>2000-05-24</hiredate>
</Emp>
<Emp>
<name>Mary Martin</name>
<hiredate>1996-02-01</hiredate>
</Emp>
Is This Answer Correct ? | 13 Yes | 0 No |
Answer / ksonga
SET VERIFY OFF
SET ECHO OFF
SET PAGES 0
SET LONG 100000
SET lONGCHUNKSIZE 10000
SET LINESIZE 200
select dbms_xmlgen.getxml('select * from emp') from dual
Is This Answer Correct ? | 7 Yes | 0 No |
What are the sql clauses supported in the link property sheet ?
Is there any function in oracle similar like group_concat of mysql?
What is the difference between count (*), count (expression), count (distinct expression)?
What WHERE CURRENT OF clause does in a cursor?
What would you use to improve performance on an insert statement that places millions of rows into that table?
What is the use of aggregate functions in oracle?
What does COMMIT do ?
What is a shared pool?
How data locks are respected in oracle?
How to handle a single quote in oracle sql?
What is a Data File ?
What is a database table in oracle?