Home » Developer & Programmer » JDeveloper, Java & XML » for ORACLE+XML
for ORACLE+XML [message #319077] Fri, 09 May 2008 00:12 Go to next message
malvika
Messages: 55
Registered: May 2008
Location: india
Member

here i want to use XML in ORACLE9i ( on linux).
but no any XML function work .
is any package required to install for this problem.
Re: for ORACLE+XML [message #319094 is a reply to message #319077] Fri, 09 May 2008 00:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 Go to previous messageGo to next message
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 #319127 is a reply to message #319117] Fri, 09 May 2008 02:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
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 Go to previous message
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
Previous Topic: How to install JDBC driver for SQLdeveloper
Next Topic: Converting XMLTYPE data to CLOB and getClobVal() (merged 3)
Goto Forum:
  


Current Time: Tue Dec 17 23:35:00 CST 2024