Mao (xml) test multiplication (2): pl/SQL method, xmlpl
Oracle supports xml. You can use pl/SQL to process xml data.
The following example uses dbms_output for xml processing.
Similarly, you can Insert the result into the table.
Declarex xmltype: = xmltype ('<? Xml version = "1.0"?> <Config> <! -- There is a lot of data between config and rules, which is simplified here --> <devices> <entry> <vsys> <entry> <rulebase> <security> <rules> <! -- There are hundreds of entries under rules, which are simplified here, leave only one piece of data --> <entry name = "GlobalProtect"> <from> <member> untrust-1 </member> <member> untrust-2 </member> </from> <> <member> dmz1 </member> <member> dmz2 </member> </to> <source> <member> any </member> </source> <destination> <member> DC01_FW01_eth11 </member> </destination> <source-user> <member> any </member> </source-user> <category> <member> any </member> </category> <application> <member> any </member> </application> <service> <member> service_https </member> <member> TCP_80 </member> </service>
Output result
GlobalProtect,untrust-1;untrust-2,dmz1;dmz2,any,DC01_FW01_eth11,any,any,any,service_https;TCP_80,any,test,traffic_log
Note: In the red part, ";" is the internal Separator of nodes with multiple values, while "," is the delimiter between nodes.