解析XML時,逃避我有一個簡單的表是這樣的:壞性格從Oracle CLOB
MyTable (id number(10), configuration CLOB)
在Oracle 11g中(11.2.0.1.0)
在Windows上運行。
現在,這裏是我的代碼:
declare
vconfiguration clob;
vxml xmltype;
vstring varchar(255);
begin
select configuration into vconfiguration from mytable where id=1;
vxml := xmltype(vconfiguration);
dbms_output.put_line(vconfiguration);
vstring := vxml.extract('/SmtpConfiguration/From/text()','xmlns="http://www.blabla.com/Drivers/Smtp"').getStringVal();
dbms_output.put_line('From=' || vstring);
end;
這裏是輸出:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SmtpConfiguration
xmlns="http://www.blabla.com/Drivers/Smtp">
<From>"[email protected]"</From>
<MultiRecipients>TO</MultiRecipients>
<ServerAddress>smtp_server1</ServerAddress>
<ServerPort>25</ServerPort>
<UseAuthentication>false</UseAuthentication>
<UseSSL>false</UseSSL>
</SmtpConfiguration>
From="[email protected]"
我想要做的是一樣的東西insert into anothertable(from) values (vstring);
如何獲得的從價值用適當的標籤「而不是&」;?