|
| Re: for ORACLE+XML [message #319094 is a reply to message #319077 ] |
Fri, 09 May 2008 00:58   |
Michel Cadot Messages: 15238 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
Do you think we can help you in any way with what you posted.
Are you sure you did something valid?
Regards
Michel
|
|
|
| Re: for ORACLE+XML [message #319117 is a reply to message #319094 ] |
Fri, 09 May 2008 02:04   |
malvika Messages: 37 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 #319127 is a reply to message #319117 ] |
Fri, 09 May 2008 02:16   |
Michel Cadot Messages: 15238 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
As we don't have your data, it is hard to tell you if what you retireve may be what you expect to retriever.
Post a test case: create table (standard one), insert statements (few rows), what you get with your query, what you expect with these data.
But before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Regards
Michel
|
|
|
| Re: for ORACLE+XML [message #319139 is a reply to message #319127 ] |
Fri, 09 May 2008 02:36  |
malvika Messages: 37 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
|
|
|