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 update values on multiple rows in oracle?
Are truncate and delete commands same? If so why?
Is oracle an operator?
acname actype amount ac1 credit 300 ac2 credit 4000 ac1 debit 4000 ac2 debit 455 ac1 credit 500 how to get sum of credit and sum of debit for each account
What are the four Oracle system processes that must always be up and running for the database to be useable?
What is the difference between SQL, DDL, and DML?
7 Answers BeBo Technologies, Wipro,
Is primary key = unique key,not null? If yes,please explain IF No,please explain
What do you understand by a database object? Can you list a few of them?
Is it possible to set second Primary Key Constraint in a table in Oracle Database ?
10)In an RDBMS, the information content of a table does not depend on the order of the rows and columns. Is this statement Correct? A)Yes B)No C)Depends on the data being stored D)Only for 2-dimensional tables
How to write date and time interval literals in oracle?
Given two table employee and department EMP ---------------- empid deptid(fk) Dept --------------------- deptid(pk) deptname que-Write a query to find count of employee in each department. Expected Output- deptid countofEmployee --------------------------- 10 57 20 20 30 15