|
|
Re: for ORACLE+XML [message #319117 is a reply to message #319094] |
Fri, 09 May 2008 02:04 |
malvika
Messages: 55 Registered: May 2008 Location: india
|
Member |
|
|
yes.
i want to transfer my table data into XML format using XMLForest function and this is the code for that :
create table trans
(
trans_date date,
trans_id number(10),
trans_type varchar2(1),
trans_amount number(12,2)
)
partition by range (trans_date)
(
partition Jan2003 values less than (to_date('01/02/2003', 'dd/mm/yyyy')),
partition Feb2003 values less than (to_date('01/03/2003', 'dd/mm/yyyy')),
.
.
.
);
insert some data.........
select xmlforest(trans_id,trans_type) from trans;
here i can't get actual result which i want.........
for this function i want the result in this picture....
XMLFOREST(TRANS_ID,TRANS_TYPE)
----------------------------------------------------------------
<TRANS_ID>1</TRANS_ID><TRANS_TYPE>D</TRANS_TYPE>
<TRANS_ID>2</TRANS_ID><TRANS_TYPE>C</TRANS_TYPE>
but it can't display any rows or data
|
|
|
|
Re: for ORACLE+XML [message #319139 is a reply to message #319127] |
Fri, 09 May 2008 02:36 |
malvika
Messages: 55 Registered: May 2008 Location: india
|
Member |
|
|
here is full code :
create table trans
(
trans_date date,
trans_id number(10),
trans_type varchar2(1),
trans_amount number(12,2)
)
partition by range (trans_date)
(
partition Jan2003 values less than (to_date('01/02/2003', 'dd/mm/yyyy')),
partition Feb2003 values less than (to_date('01/03/2003', 'dd/mm/yyyy')),
.
.
.
);
insertion code :
begin
for ctr in 1..100 loop
insert into trans values
(
sysdate - dbms_random.value(1,300),
ctr,
decode (round(dbms_random.value(1,2)),1,'C','D'),
dbms_random.value(1,10000)
);
end loop;
end;
/
select xmlforest(trans_id,trans_type)
from trans;
my xmlforest function is not working.
now, what neccessary step is required or tell me where i am missing
or is there any other method to transform data into XML format
|
|
|