I want to create a trigger, which updates a single node in my xml file. I have a table with 2 rows, where one is the id of the entry and the other one is a xml type
drop table product_information_xml;
create table product_information_xml(
information_id Number(6,0),
products XMLType);
So, now one entry looks like this
"INFORMATION_ID" "PRODUCTS"
5 <products>
<product_id>1</product_id>
<product_name>samsung galaxy note</product_name>
<product_description>mobile phone</product_description>
<category_id>11</category_id>
<weight_class>2</weight_class>
<warranty_period>+000000000-06</warranty_period>
<supplier_id>102069</supplier_id>
<product_status>orderable</product_status>
<list_price>500</list_price>
<min_price>400</min_price>
<catalog_url>www.samsung.de</catalog_url>
</products>
So now I have another table which isn’t xml. And has all XML tags as single columns. So the columns are product_id, product_description etc.
When I update the product_id how do I update the xml node <product_id> in the xml table? Can anybody help?
What I know yet is that I start with
Create or replace trigger delete_xml
after update on product_information
for each row
begin
update ?????
end;
Now I am stuck. I would love for help!
If you don’t know which node you’ll update, maybe it will be easyier for you to update the whole XMLTYPE-