how to retrive xml data for using sql query?

Answer Posted / d ashwin

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a subquery in oracle?

578


How many data types are supported?

615


In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col

3700


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1260


What is the use of oracle?

553






How to delete multiple rows from a table in oracle?

563


Where do you use decode and case statements?

554


Is oracle the best database?

520


Does facebook use oracle?

573


Which is better Oracle or MS SQL? Why?

3974


what is the difference between functional dependecy and multilevel dependency?

1993


How to define default values for formal parameters?

594


How to insert a new row into a table in oracle?

589


What are group functions in oracle?

584


interview questions with answer for cts

2088