Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005

    Unanswered: Convert relational data into XML

    Hi Guys,

    Is there any way i can convert relationnal data straight away into a valid
    xml data in oracle itself..

    I plannnig to have a stored procedure which does this, then i want to call it
    from my dotnet application and retrieve the xml data straight away..

    Would appreciate if i can have some guidelines/reference for me to get started with this

    Like for example, i issue the following command

    select column1, column2 from table1

    Is it possible for oracle to give me back the results in xml format?

    thanks in advance..

  2. #2
    Join Date
    Aug 2004
    I think DBMS_XMLGEN is what you need :
    rbaraer@Ora10g>  create table testtable(id number primary key, text varchar2(100 CHAR));
    Table created.
    rbaraer@Ora10g> insert into testtable values (1, 'This is the first value');
    1 row created.
    rbaraer@Ora10g> insert into testtable values (2, 'This is the second value');
    1 row created.
    rbaraer@Ora10g> commit;
    Commit complete.
    rbaraer@Ora10g>  begin
      2  dbms_output.put_line(dbms_xmlgen.getxml('select id, text from testtable order by id'));
      3  end;
      4  /
    <?xml version="1.0"?>
      <TEXT>This is the first value</TEXT>
    is the second value</TEXT>
    PL/SQL procedure successfully completed.
    HTH & Regards,

    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

  3. #3
    Join Date
    Feb 2005

    Thanks for the reply, this is definely give me a good starting point and the link was excelllent, thanks,

    rgds, ajit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts