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

Home -> Community -> Usenet -> c.d.o.misc -> Help with PL/SQL and XmlType

Help with PL/SQL and XmlType

From: stork <tbandrow_at_mightyware.com>
Date: 2 Jun 2005 12:45:28 -0700
Message-ID: <1117741528.671602.221660@g43g2000cwa.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 - 14:45:28 CDT

Original text of this message

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