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 type of Synonyms?
How to rebuild an index in oracle?
i have a table with 1 lac of data.i want to insert this data into another table. i want every 5000 of data insert use a commit.using counter and if error is comming in the 5000 of data it rollback.
How to drop a tablespace?
How to work with data objects interactively?
How can I see all tables in oracle?
How to start an oracle instance?
I want a table like, no name address addr1 addr2 So i want columns like addr1,addr2 under address column. Can one please answer me. Advance Thanks.
Is it possible to enter only time value into a column of a table in sql?
Find all employees in Dept “Marketing”.
How to sort output in descending order in oracle?
What is Java Pool in Oracle?