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 |
How to define an anonymous block?
Write a simple Store procedure and pass parameter to it ?
what is the difference between authorization and authentication?
Calculate difference between 2 date / times in oracle sql?
How to delete all rows a table in oracle?
Why do we use bulk collect in oracle?
What is the CAP theorem?
From the database level, how can you tell under which time zone a database is operating?
Is it possible to enter only time value into a column of a table in sql?
Explain the use of grant option in exp command.
How can we Update a table with out using UPDATE command?
How to count groups returned with the group by clause in oracle?