Skip to content

Tag: xml

How to convert generic XML to a table row in PostgreSQL?

PostgresSQL v12.5 There is a table with single column containing strings formatted as XML. For simplicity let’s claim that there are no nesting: all tags inside <something> contain primitive values (strings). Assuming that there are much more elements than <a> and <b> inside, it would be great to have an option to convert these values into a relational form without

How to select values between a XML tag in SQL Query

I have a table with CLOB column storing a XML. The structure of XML is unreadable. I want to get values between few tags like <DOMAINID>; sample is shown below. XML: I am using this: Expected result: Actual XML: Answer Do not use regular expressions to parse XML; use a proper XML parser. However, what you have is not properly

Extracting multiple values from BLOB as XML

I have an XML like this in a BLOB column: As you can see the year can be either in the event level or at country level. There can be multiple events and multiple countries per event. This whole XML is stored in a BLOB column in Oracle. I need to extract the value of the year or better check