Transforming myTableWithManyColsAndRows -> myTableWithOneXmlTypeColumn as follows:
declare
result xmltype;
begin
result := dbms_xmlgen.getxmltype('select * from myTableWithManyColsAndRows')
insert into table myTableWithOneXmlTypeColumn values result;
end;
Can I do the reverse, transform: myTableWithOneXmlTypeColumn -> myTableWithManyColsAndRows ?
That is, can I somehow construct a SQL statement that would query myTableWithOneXmlTypeColumn and return the same results as 'select * from myTableWithManyColsAndRows'?
To get back the rows and columns from XML, you need to use XMLTable. tag has multiple tags. So, first step is to extract those and map to a XMLType( xmlrow). From this, the individual columns are extracted.