Monday, April 13, 2015

Useful DB2 functions




Convert a CLOB (having text data) to String:


  SELECT Col1,CAST(CLOB_Col2 as varchar(2000)), Col3 FROM "Schema"."Table"


Convert a CLOB column (having XML data) to String


  SELECT XMLSERIALIZE(Col1 AS VARCHAR(600)), Col2 FROM "Schema"."Table"
Keep watching for more!

No comments: