Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

UPDATEXML help required

user8941550Mar 28 2013 — edited Mar 28 2013
Hi,

I am trying to use updatexml in a simple example but getting Invalid Path Expression.
drop table xml_tbl;

create table xml_tbl (
xml_msg_id integer,
xml_msg_text xmltype
);

insert into xml_tbl values(1, '<main xmlns:ns1="Abc:SET"><ns1:id>1</ns1:id></main>');
 
insert into xml_tbl values(1, '<main xmlns:ns1="Abc:SET"><ns1:id>2</ns1:id></main>');
I can query this easily as:
SELECT *
  FROM xml_tbl
 WHERE XMLEXISTS ('declare namespace ns1 = "Abc:SET";/main[ns1:id="1"]'
                  PASSING xml_msg_text)
But when I use UPDATEXML I get the error as:
Update xml_tbl
set xml_msg_text = updatexml(xml_msg_text,
                                                               'declare namespace ns1 = "Abc:SET";/main/ns1:id',
                                                               '8')
 where xmlexists
 (  'declare namespace ns1 = "Abc:SET";/main[ns1:id="1"]' passing xml_msg_text )

 
ORA-31013: Invalid XPATH expression

Please help.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 25 2013
Added on Mar 28 2013
1 comment
641 views