Microsoft Sql Server search and replace data inside xml

If column is of XML type or you can change to XML type, update can be done in a single statement: ALTER TABLE myTable ALTER COLUMN col2 XML ; GO UPDATE myTable SET col2.modify ( ‘replace value of (/loadTest/Groups/Group[Name/text()[1]=(“testScript1”)]/VUsersNumber/text())[1] with (“2300”)’ ) WHERE col1 = 358 ; GO Otherwise use cast: DECLARE @l_xml XML SELECT […]

Read More Microsoft Sql Server search and replace data inside xml
March 21, 2018

Display Oracle SQL Developer XMLTYPE

Do you see annoying (XMLTYPE) in Oracle SQL Developer output? Wrap the column in the xmlType.getClobVal function to see the actual data. WITH q AS ( SELECT XMLTYPE ( ” ) AS col1 FROM DUAL ) SELECT q.col1 , XMLTYPE.GETCLOBVAL ( q.col1 ) FROM q ;

Read More Display Oracle SQL Developer XMLTYPE
October 10, 2016

One Comment

Create output XML data files from oracle with dbms_xmlgen

The below code will generate XML format output, just plug in any SQL and it will work without further development. This is based on three articles by other authors: Tim Hall – but Tim’s code has a bug that stops it outputting after the first 32k of data. Tom Kyte – the fix for that […]

Read More Create output XML data files from oracle with dbms_xmlgen
January 26, 2014

One Comment