Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL XmlType as table question

PL/SQL XmlType as table question

From: stork <tbandrow_at_mightyware.com>
Date: 2 Jun 2005 13:56:57 -0700
Message-ID: <1117745817.037361.166290@z14g2000cwz.googlegroups.com>


Why does this?

declare

  var       XMLType;
  var2          XMLType;
  buf       varchar2(2000);

  type refcur is ref cursor;
  rc refcur;
begin

   var := xmltype('<PERSON> <NAME ike="uno"> ramesh </NAME> <NAME ike="duo"> foo </NAME> </PERSON>');

   var2 := var.extract( '/PERSON/NAME[@ike="uno"]' );

   dbms_output.put_line( 'hello' );
   OPEN rc FOR
   SELECT extract(value(xooty), '//NAME/text()').getStringVal(­) AS empno

   FROM table(xmlsequence(extract(var, '/PERSON'))) xooty;    LOOP

          fetch rc into buf;
      dbms_output.put_line( buf );
          exit when rc%notfound;

   END LOOP;
end;

return this:

ramesh foo
ramesh foo

I wasn't expecting ramesh and foo to be combined on each row??? Received on Thu Jun 02 2005 - 15:56:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US