我的表中存储了以下数据[fixed_width_export_specification_t] [specification_xml]'
<fixed_width_metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fixed_width_metadata_row>
<rowtype>sys_header</rowtype>
<dbname>sys_nm_label</dbname>
<width>56</width>
<fillleftright>right</fillleftright>
</fixed_width_metadata_row>
<fixed_width_metadata_row>
<rowtype>remit1</rowtype>
<dbname>remit_column1</dbname>
<width>32</width>
<fillleftright>right</fillleftright>
</fixed_width_metadata_row>
</fixed_width_metadata>
我想更新rowtype等于remit1的宽度,dbname等于remit_column1从32到61
我使用不同的xqueries来玩。我不知道如何隔离我想要的元素即宽度,然后随后更新其值。
答案 0 :(得分:0)
update fixed_width_export_specification_t
set specification_xml.modify
('replace value of (/fixed_width_metadata/
fixed_width_metadata_row
[rowtype = "remit1" and dbname = "remit_column1"]/
width/text())[1]
with 61 ')